|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 3 N; G% D/ b5 `7 u R- c
Use the CCO.Email object to send email messages.
& F1 s2 f1 G8 E! e/ L3 d) P, ~( xC# 7 f3 [/ `" w# L# }
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); & Y2 U' k8 m9 b4 Q
email.From = fromEmail; U: N, {- a8 q
email.To = toEmail;
7 a+ p, d: E2 V% Z3 t$ z0 }email.Subject = subject; 1 g2 j1 \! Y: ]6 P- n
email.Body = body;
+ C- t" ~ L: n. n/ ^ uCCO.Email.setup_smtpmail_server_and_send(email);
" a( k$ S2 M" q) V . G& I Q8 J) v# d3 z
// Alternatively use the SendEmailToIdentity
. d* z: o9 t- \// The first argument is the Identity name to send the email message. 9 ]5 `+ C* Z$ l' \3 X
// The second argument is the subject text. d1 A0 |% Y% z
// The third argument is the email body text. , u' n K# Q7 i+ z& [- Y: N) d
// The last argument is a user login name as the sender and
0 e! q2 S' u; G// if blank will use the logged in user name and 1 Y3 X* @' P9 V% r: t+ i5 s
// that User Item must have an email address as well.
' N1 U; l' P' a3 a! R. C# U9 \CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 0 N0 k% C( W$ l% d9 o+ f& g" q$ V J
return this.newInnovator().newResult("ok");
5 _( a3 ?7 B7 z+ z- C" U& ~% M' u VB.Net
0 R+ N. I8 B) [Dim email = New System.Web.Mail.MailMessage() 1 h# }' I' E, G' }& m2 Z
email.From = fromEmail 0 x( h' I* g& y* ? H& |; z. d
email.To = toEmail
+ s& u9 H5 l* Temail.Subject = subject 5 k! d7 t& a9 w# Q7 n
email.Body = body + w# P: h; c# x* t
CCO.Email.setup_smtpmail_server_and_send(email) + S ~ p' r3 W3 F4 [6 V
0 n. G( ]2 v: g7 }
' Alternatively use the SendEmailToIdentity % }3 x5 g8 e0 N! r; s, J2 k
' The first argument Is the Identity name To send the email message. * \0 A3 E4 {" Y) |5 r' J
' The second argument Is the subject text.
& f, W7 P+ V* U( r' The third argument Is the email body text. " C: k+ w* V$ U5 c; b
' The last argument Is a user login name As the sender And
$ F/ J7 l+ M1 f0 ~- U' If blank will use the logged In user name And
5 F' @! H, l8 |) U _' that User Item must have an email address As well.
6 W5 v( V3 ], v0 v }0 _7 [# S- HCCO.Email.SendEmailToIdentity(identity,subject,body,user)
3 n% V+ F7 _5 G! o* t, v
1 x, H/ Y3 M/ s. D( R9 S0 X7 `. _ |
|