|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
* z1 }0 W, I* m9 @Use the CCO.Email object to send email messages. " _" T; a) ^ j! g: ?. {0 v
C#
' |5 N6 x2 n; P5 T- d) O, tSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); : U1 m- ^% \7 x( `7 Z6 Y& G
email.From = fromEmail;
' ~9 Y; Y2 M9 y: S9 @% o, nemail.To = toEmail; 3 Y0 n5 J, n0 h% o) _
email.Subject = subject; ; B# l) b7 f; s+ F
email.Body = body;
6 l& ~2 I- q- e3 uCCO.Email.setup_smtpmail_server_and_send(email); 1 J0 {& o! n; O# m3 S) [& }7 @" F" ^
! j+ p3 @( z% i3 ?+ l+ \* ~5 h
// Alternatively use the SendEmailToIdentity & `2 r6 \! p+ i7 y6 P4 u
// The first argument is the Identity name to send the email message.
D7 q1 v2 f/ r- D// The second argument is the subject text.
* _# f4 X) R& c// The third argument is the email body text. 3 L) X: p% ?$ I1 n
// The last argument is a user login name as the sender and
( R! _1 Y: k) h9 z// if blank will use the logged in user name and
! `/ o" x. D3 p- R" D// that User Item must have an email address as well.
1 }6 S7 {7 h7 c. A9 D& w6 J" sCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 1 I& E; g7 q9 h G2 k
return this.newInnovator().newResult("ok");
, L( m7 S/ a8 _9 `4 | VB.Net
9 w" @$ D) _) l& JDim email = New System.Web.Mail.MailMessage()
2 \: r( W" ?4 O- [# @email.From = fromEmail
& X- E0 L% p9 x: N/ pemail.To = toEmail
, V4 L) a, e/ A0 k1 t( \9 F0 Y4 qemail.Subject = subject ; D! J5 V) C) k) _9 z. N
email.Body = body * |4 P' s0 ^$ L6 d. [# g) w6 T
CCO.Email.setup_smtpmail_server_and_send(email)
8 @. {4 i0 \; \" P1 o' v
/ n( a' K1 ]; {; _0 A) g8 y( l5 l' Alternatively use the SendEmailToIdentity 8 W: \; p# C Y% A* {$ p5 X
' The first argument Is the Identity name To send the email message. 1 M1 E G3 G) J; S9 e
' The second argument Is the subject text.
4 R0 ]7 @+ q1 K |) W, h' The third argument Is the email body text.
! ~1 d5 C1 Q8 z3 [+ B) ^, Z2 M' The last argument Is a user login name As the sender And
! V! s1 p7 Z/ ]8 Y+ |' If blank will use the logged In user name And
+ i- M3 Q! n2 ~* \' that User Item must have an email address As well.
& }3 L* y' U2 B4 l' DCCO.Email.SendEmailToIdentity(identity,subject,body,user)
0 a* b. G/ N: y+ C2 A) u8 q t3 H+ F8 l0 i
|
|