|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
8 U$ @# G0 j# WUse the CCO.Email object to send email messages. 6 Z4 L0 y8 P* ?1 P; M! d9 ]7 P9 H
C# * B6 A: o* n) C3 N; s" n
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
) v3 u+ Q% X$ b- demail.From = fromEmail;
0 L1 ?6 T8 _- L3 p# l4 Temail.To = toEmail;
8 ]" r- n/ n* S/ _2 k$ y3 ~0 bemail.Subject = subject;
* n$ A4 L, Z0 J9 Pemail.Body = body;
( M( R& |; f/ ~$ `/ gCCO.Email.setup_smtpmail_server_and_send(email); $ ]& B$ z1 ?/ a& x0 _* u
$ K% M E* z, ?# ~
// Alternatively use the SendEmailToIdentity
6 X$ Z" s( m0 c$ G( o: P0 N% N// The first argument is the Identity name to send the email message.
+ j% e# E7 W7 E( b* M# f) F// The second argument is the subject text.
! }' O+ u2 p+ u' O, B// The third argument is the email body text.
& U0 P* |# N+ W0 K3 U3 s6 S( F- _/ R// The last argument is a user login name as the sender and
J0 ?; n8 A1 Q& v0 L$ V6 b// if blank will use the logged in user name and _, X6 j* [3 Y, d7 i+ i
// that User Item must have an email address as well. ; X" G0 z& O7 [; a1 r" U! n
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); . @& c9 g6 L% C2 U/ A0 ]- |- H8 H8 ?
return this.newInnovator().newResult("ok");
6 S" H0 I% v5 R6 }6 I VB.Net
: U9 _$ u+ S; t. A+ _9 J" _ ]6 \Dim email = New System.Web.Mail.MailMessage() , ~, u% u* o& F- \/ `" ~* |# h, t
email.From = fromEmail ! n* `2 g' _1 B
email.To = toEmail " D# i* x) i9 W! _. g% i
email.Subject = subject ; ?2 Q: X) Q0 R* k* O
email.Body = body % a* U3 D% C# x2 t4 \7 O4 v3 X
CCO.Email.setup_smtpmail_server_and_send(email) ) H- S* Q8 H# E% d
# J$ e/ p/ |+ ?5 k- N! Z5 i/ l$ j' ?' i' Alternatively use the SendEmailToIdentity
* l/ k$ A+ R" `( m! Y' The first argument Is the Identity name To send the email message. 2 C) t5 V3 y' B" o: M! W
' The second argument Is the subject text.
! Z# S; [9 ^% d' The third argument Is the email body text. - d* Z/ s9 D7 _( U# }5 ~; C0 f
' The last argument Is a user login name As the sender And ' q' g9 Z% N- w6 n7 p. u! E
' If blank will use the logged In user name And
% Z0 u# T/ K* _# d2 U' that User Item must have an email address As well. / f+ l4 Q+ @5 S( F0 s2 K( N* {
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
0 Y/ y e. O, u% v' F; ~6 K% ~! _0 u9 M' n2 s' E
|
|