|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
0 h0 J& n4 C/ W5 z+ i( F/ {( kUse the CCO.Email object to send email messages. 4 f7 ]! `/ ?5 Q$ b: X7 ]6 Q; X. A, g
C# ( `7 m6 `8 c9 d3 g8 ]' ^
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); + { ]1 k7 A/ f. ]7 x7 C7 @
email.From = fromEmail;
' J1 I* F9 U) C# a1 u: k' Eemail.To = toEmail; ! F# j) X; q( [: S/ Y
email.Subject = subject; # |% b" e6 v% I3 v& m1 H" Y3 C
email.Body = body;
$ t" Q' G& o& I. N; D A/ t" SCCO.Email.setup_smtpmail_server_and_send(email); " ?& b# I# y/ C4 }+ D
) U& H+ g0 w5 R5 Y// Alternatively use the SendEmailToIdentity
$ y0 T! Z6 s' U# O# K3 w1 `- z' W// The first argument is the Identity name to send the email message.
& l- \; o# B; |+ V// The second argument is the subject text.
5 b3 N! P4 w- h0 }2 E" ?// The third argument is the email body text. ' B& l2 w6 F7 z) K7 `
// The last argument is a user login name as the sender and
8 l. m2 E# a6 z: Q8 r# d& f// if blank will use the logged in user name and
! L/ f- ~ v3 f( J. d, U, v. u2 X( N// that User Item must have an email address as well.
1 ?, T$ P! b, jCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); + \+ m& T& H3 c
return this.newInnovator().newResult("ok"); # e, q' G8 j4 S% B/ @" N$ n" S' d
VB.Net
* a- m d9 f2 E9 D) A* b! SDim email = New System.Web.Mail.MailMessage() - ~+ F9 u1 d2 d/ g
email.From = fromEmail 7 ^0 P2 O" E! _2 _5 M$ u, B
email.To = toEmail
+ _( |+ i' U1 W; @) E# S |email.Subject = subject
. t0 v1 D; m/ d3 E% a+ Bemail.Body = body / [9 a+ l1 W. \9 V: @ q! V
CCO.Email.setup_smtpmail_server_and_send(email)
* E5 d6 \- v# ]8 }2 |, y
9 m+ W5 T* r- H' Alternatively use the SendEmailToIdentity ( C1 \5 U" P8 G( q, ?
' The first argument Is the Identity name To send the email message. 6 C3 A, B& A$ `! S2 n# D( i2 P
' The second argument Is the subject text.
. A& N2 h8 i# @1 F! q' The third argument Is the email body text. 2 H+ E- v& I' T
' The last argument Is a user login name As the sender And
/ d' w' R) k/ l$ O. O' If blank will use the logged In user name And
$ |. C- t* `% [; Z' that User Item must have an email address As well. 2 d8 s; }- H% t3 d7 c! p# B
CCO.Email.SendEmailToIdentity(identity,subject,body,user) . Y+ O1 l( j5 Y; D C6 h
6 k2 M- C- L2 I$ o6 E5 i1 L" p
|
|