|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
4 P% k) O, q* g; l+ O3 E! [Use the CCO.Email object to send email messages. ; j# z) q. T1 u( F0 P- L
C# ! z$ z- Q8 K0 S0 s. i6 u/ x8 o* H3 @0 ]
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& L2 k A( G( H, Aemail.From = fromEmail; $ @: r. n6 ]- u8 W" }; \
email.To = toEmail;
p4 f9 A- Y8 G0 O7 F6 p' ~$ `0 c5 Aemail.Subject = subject; 6 ^2 w0 ^- d" O; |. \2 c8 p
email.Body = body;
U) O7 { J8 J; CCCO.Email.setup_smtpmail_server_and_send(email);
" P @( B3 K. S
# Q' b7 I4 W" U# m; W* {// Alternatively use the SendEmailToIdentity 8 N& W- a) U8 d
// The first argument is the Identity name to send the email message.
* |. s8 E8 A! w! F( [// The second argument is the subject text. 3 y# ]3 j2 h) W- }! ?0 y
// The third argument is the email body text. 9 O' ~1 [) J) W: [4 X
// The last argument is a user login name as the sender and ( ~: Q$ T; f9 G! Z; ^" a: }$ U# A
// if blank will use the logged in user name and
. y$ r* ^( I+ }4 E V3 }/ P" o// that User Item must have an email address as well. ' s: Z+ \, d; x4 x7 o1 P2 ~' @
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 1 C* R( w* G. ^+ ?# H4 O
return this.newInnovator().newResult("ok");
2 p' j- D; |4 {8 o7 s5 {0 @ VB.Net 9 k' L& O3 L; z$ Z, Q4 h2 }! G7 y
Dim email = New System.Web.Mail.MailMessage()
8 K" l/ i" c; K% B) F+ d1 `email.From = fromEmail 6 I+ K% t4 }& c
email.To = toEmail
2 l4 z) D- p: Q+ S3 P, eemail.Subject = subject " _1 k. ^+ b& F+ U5 M. Z
email.Body = body 6 [. N# ]3 ?7 |% `1 h
CCO.Email.setup_smtpmail_server_and_send(email)
0 M% e8 T1 V0 ]1 K " R) ~2 E+ k9 J. g) j7 O) ~; C
' Alternatively use the SendEmailToIdentity
1 R! i4 ]$ @5 V$ c- |/ [3 r4 M4 W( x' The first argument Is the Identity name To send the email message. 3 Q f2 L- |4 f$ J! h9 Z
' The second argument Is the subject text. , j3 s$ R: ]! U7 x1 L
' The third argument Is the email body text. 9 l5 j' V6 R) u- F8 m! [; O2 C
' The last argument Is a user login name As the sender And
7 l; ?, S* R; i1 l5 U% r6 x' If blank will use the logged In user name And : C w8 [3 u* K. @* S: a X
' that User Item must have an email address As well.
9 V) }" ? b! f% J, T& sCCO.Email.SendEmailToIdentity(identity,subject,body,user) ( Z% \0 K" X) y# t
/ s9 s$ p2 U/ R) k |
|