|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 4 L& t. Q: K- u' }+ o* J- h* ^/ n
Use the CCO.Email object to send email messages.
7 ?4 c- |2 P) OC#
' Z" A3 q- x+ k( t- gSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
, M& G' |( j, A$ K2 \+ semail.From = fromEmail;
: O; ^( q9 c* x/ k3 L8 Temail.To = toEmail; 2 ]( K N2 j0 R* @
email.Subject = subject; 3 m9 H- {# ^" j
email.Body = body; 3 z4 X8 {! t: Z! a$ K
CCO.Email.setup_smtpmail_server_and_send(email);
% o" Q) O# _1 A1 x* k$ ?. x
' i# J/ _0 Y4 T/ {$ U( W# q// Alternatively use the SendEmailToIdentity
$ n6 k# C! |& V! S: ]0 H! v// The first argument is the Identity name to send the email message. ) r% s! v2 b4 w
// The second argument is the subject text. / Q2 _# g3 o: W2 u' B
// The third argument is the email body text.
% m5 P/ f: s( i4 t( X( ]// The last argument is a user login name as the sender and
7 F- R- p- L( y# n; Z0 t( E( X// if blank will use the logged in user name and " J2 F5 f4 R0 T' H8 u! c
// that User Item must have an email address as well. 3 O& d. r5 _/ y( j% R, r
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
6 S! T3 `- v3 K3 Y3 Vreturn this.newInnovator().newResult("ok"); 6 K+ S; U, ?0 @& ^ T( T
VB.Net
! V' j8 Z) w, g0 O6 O2 V/ {Dim email = New System.Web.Mail.MailMessage() 7 ]3 I) |2 c# C
email.From = fromEmail
0 X, V% v5 m2 E1 M! b6 t: _5 d1 B: Bemail.To = toEmail
- x- J) ]3 d8 Z# Jemail.Subject = subject + A' y6 V; ^! W' \5 @6 X4 F
email.Body = body
0 N9 i2 I' u! Q( a2 `6 o) r, O, qCCO.Email.setup_smtpmail_server_and_send(email)
1 c6 L: J g ^
, J( [1 G5 @& s) ?' Alternatively use the SendEmailToIdentity
* L; b8 G& Y$ _' The first argument Is the Identity name To send the email message.
. H/ v4 U- E& v# ]' The second argument Is the subject text.
" e" t* C8 U$ X# U' The third argument Is the email body text.
# Y! s/ W7 G l1 t" G. U' The last argument Is a user login name As the sender And 9 x. A& X- S/ R5 _0 Q* G
' If blank will use the logged In user name And / F7 m7 H+ u4 f u
' that User Item must have an email address As well.
: I3 n5 n; h* u! lCCO.Email.SendEmailToIdentity(identity,subject,body,user) # h" a/ H: r( m8 p
3 H x9 e# F. L k0 W8 i |
|