|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique # |6 q& G$ I n/ }0 s) O# b. V: ~
Use the CCO.Email object to send email messages.
) i9 q- }3 N; f P+ L) ~8 \% XC#
* y8 V6 O7 m! a- n SSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 5 c$ H/ L& `# H0 M% _' H
email.From = fromEmail; % R( x$ L' F$ W4 F+ x8 G
email.To = toEmail; * n7 [/ g" r$ e G3 c/ D# k* o& U
email.Subject = subject; 4 Q( m/ t/ u6 U$ N" K$ n
email.Body = body; ) H, ~) n! K( G5 P3 f6 T
CCO.Email.setup_smtpmail_server_and_send(email);
" a, `! x3 D4 K9 j0 o; p
3 [+ \! m; G+ g8 B// Alternatively use the SendEmailToIdentity
8 ]. t' V$ D2 \4 b% s& p// The first argument is the Identity name to send the email message. , E r( Q: D, a, i+ B
// The second argument is the subject text.
2 _1 T/ K! i2 G// The third argument is the email body text.
) s5 K9 K! c; y s2 ^4 z# C// The last argument is a user login name as the sender and 4 x- ]& `$ D9 N' r( Q! a
// if blank will use the logged in user name and
' D! x# J+ b; j9 w$ h# l5 h% B3 A// that User Item must have an email address as well.
& [. j" ^2 H' fCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ) X; K2 i' @* [, L
return this.newInnovator().newResult("ok"); 6 r/ q2 J: U" C+ n
VB.Net + Z+ G7 D& Z r, d! A$ c0 q5 Q2 a3 S8 p
Dim email = New System.Web.Mail.MailMessage() 9 b+ s1 } ^7 k4 W* E7 p
email.From = fromEmail
3 E" I$ b2 r; u J! hemail.To = toEmail ' e5 q% z* p( M9 z0 m
email.Subject = subject
7 |0 P6 z! u% o. `" Z1 xemail.Body = body
0 R( y. e- `: w$ E$ P% e% TCCO.Email.setup_smtpmail_server_and_send(email) 2 u6 g. X" ?/ @! `' U
' T2 B+ G$ ]) y) J% }6 W
' Alternatively use the SendEmailToIdentity ! H* O+ e+ a( a
' The first argument Is the Identity name To send the email message. 7 A6 j" {& U9 U, c; z; }6 H5 U
' The second argument Is the subject text.
* x1 W4 _/ s9 m- ^3 T5 z: a' The third argument Is the email body text. ) B9 l* E/ v* P& R7 J4 k6 o0 ]
' The last argument Is a user login name As the sender And 2 Y7 l$ W8 @% {' d& ]9 _
' If blank will use the logged In user name And 1 q' W: V% Q8 Y2 J. B) V# |" M9 x
' that User Item must have an email address As well. & n q, Q- z! a$ W" n6 A8 r- E
CCO.Email.SendEmailToIdentity(identity,subject,body,user) 6 i6 _5 x9 o1 ]% C7 b+ u
2 ]. B3 T; t; g3 k( P* |
|
|