|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique % ?4 T) L; p4 E3 \
Use the CCO.Email object to send email messages.
# a% Z: o4 \$ ]8 [; x/ y: _C#
: V% n' T3 ~* s& eSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); % N# b- F6 O7 j0 j* v2 G' I& J
email.From = fromEmail;
. T) d: Q2 h: r. Memail.To = toEmail; % k( m/ J$ W0 X1 _2 `5 w) G8 D* p
email.Subject = subject;
) o; `! B X: p& v2 aemail.Body = body; * D$ Q+ N! Y8 b# m. Q0 G
CCO.Email.setup_smtpmail_server_and_send(email);
( y; l. ~$ e/ P/ p 1 a+ B/ }8 u, ?* v3 G( m; M9 ~
// Alternatively use the SendEmailToIdentity 9 X: F( [* E9 Z0 ~
// The first argument is the Identity name to send the email message.
# h& p9 d5 c. C' N1 [// The second argument is the subject text.
2 ]3 X( I% `& i// The third argument is the email body text.
+ f0 \1 e0 _& O2 T) q! \, `3 @// The last argument is a user login name as the sender and ) p+ l0 `% F( b
// if blank will use the logged in user name and ' D2 f! G' Y! q# f1 I
// that User Item must have an email address as well. 8 j: C3 P4 o# ~3 N
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); $ \ |/ Y/ N$ P6 h
return this.newInnovator().newResult("ok");
$ N1 k2 c& N9 p6 e$ N VB.Net # \! }# f4 m+ D( W8 K8 g) r, E# ~
Dim email = New System.Web.Mail.MailMessage()
9 ]/ |+ G# F1 y# Q7 e: A% _email.From = fromEmail
9 L" i/ w3 e# d4 M; _email.To = toEmail ) J" k: S7 ~; \/ `0 ~2 r1 ~ M
email.Subject = subject / Q* i3 T) a/ M
email.Body = body
$ \- r; k6 E9 }/ r+ r5 uCCO.Email.setup_smtpmail_server_and_send(email)
& J+ \" s8 w# n
1 S2 I( ~, m; B- }1 z- B' Alternatively use the SendEmailToIdentity 6 ?6 }/ M, H( b* ?5 H' v
' The first argument Is the Identity name To send the email message.
' j( W3 o. n( ^* \$ R' The second argument Is the subject text.
2 M( x8 W% R; I/ g0 q) {' The third argument Is the email body text. 6 Z& X" |" i* q2 u; j& v; T
' The last argument Is a user login name As the sender And 6 \! T5 ?+ U6 ?3 O
' If blank will use the logged In user name And
7 C5 @- q7 g7 ?9 o' that User Item must have an email address As well.
$ H/ J) \/ y% q9 |2 O7 {' K- TCCO.Email.SendEmailToIdentity(identity,subject,body,user) 6 u& y: P5 f) R/ e" `5 \
4 {5 T: u2 D- ?9 y' t6 S' y6 C9 ^! M. S |
|