|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
: u. ` o+ G! L2 E# ^! oUse the CCO.Email object to send email messages. 5 x/ w4 {- A# }8 l. @+ L
C# 1 X5 |' i {8 P/ D
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ' f8 t3 }" o4 H9 i5 Z0 N
email.From = fromEmail; 7 N& @2 {+ Y; V4 c/ @% y) |' b
email.To = toEmail; $ N5 H0 S% J( ~9 y
email.Subject = subject; & P0 f5 B$ ^+ W, ?$ K8 N' p
email.Body = body;
; @$ ^& f$ _$ Y, u4 k5 uCCO.Email.setup_smtpmail_server_and_send(email);
y. N5 ?( r% G6 @
% G! [8 i/ T1 c// Alternatively use the SendEmailToIdentity
& V' [$ F2 N/ G/ x6 P `! Y// The first argument is the Identity name to send the email message.
- S! `( q) w X. s' ~& d( G// The second argument is the subject text.
+ L2 U$ @6 S4 j2 i9 z// The third argument is the email body text.
! U. B1 V( M. e: o// The last argument is a user login name as the sender and 7 ] c3 f" L9 c: J/ {" S
// if blank will use the logged in user name and : v8 X# W2 B7 O7 o
// that User Item must have an email address as well. : f6 P5 T+ V" d+ y
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); * f& P1 P/ S: S Y0 P/ b
return this.newInnovator().newResult("ok");
4 ~% x7 n5 {* l/ {8 k9 z VB.Net
' t6 u5 X& b! Z3 Z. s. [Dim email = New System.Web.Mail.MailMessage() 4 |& @# {3 I" S x6 F5 I
email.From = fromEmail - e1 o+ Y; O1 b
email.To = toEmail 3 }& @4 k% H' x+ h% ~' V+ h
email.Subject = subject
: V8 L' x( _ e; V, d- iemail.Body = body q1 L+ q) f6 J
CCO.Email.setup_smtpmail_server_and_send(email) 3 K+ H+ Y4 p7 S" c" E _
8 d+ t7 t* B- h# W6 G5 y5 e: h
' Alternatively use the SendEmailToIdentity
! [" b! s0 ^; y' The first argument Is the Identity name To send the email message.
4 v" m$ H* P0 y$ C! ?4 f) g. U' The second argument Is the subject text. & ?; ]$ R. l3 ^
' The third argument Is the email body text. X& ]( c; H* t- n
' The last argument Is a user login name As the sender And
" w% {, u1 K1 o+ \7 |2 T% U' If blank will use the logged In user name And
$ _/ T3 l; b4 Y/ u' that User Item must have an email address As well. 3 X4 D+ j- |7 j
CCO.Email.SendEmailToIdentity(identity,subject,body,user) " N+ K3 I0 O& p* y, {* l
, P* Y2 ?1 L- d8 Q
|
|