|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique - y! G9 e3 J5 o- D
Use the CCO.Email object to send email messages. & V8 ]9 _1 g( J4 l* L! J! E! I
C#
" ^/ U" X1 \3 Z- x, W* N3 YSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ! c6 D8 Q9 U/ a2 A
email.From = fromEmail; 0 @6 L9 }" @: p7 z3 E* O
email.To = toEmail; " K9 L b2 }" h8 h% y9 u% J* k
email.Subject = subject; ) u: {. H2 v! `- t. F& L, m8 l# n
email.Body = body;
0 l% {7 p* K3 t9 i! W' ]CCO.Email.setup_smtpmail_server_and_send(email);
. b0 H3 n# Q4 k1 j1 ^! X % Y& d/ L' m9 |8 {& w
// Alternatively use the SendEmailToIdentity
. d W1 i2 \% @% y// The first argument is the Identity name to send the email message.
* ?% x- w- t+ r' R// The second argument is the subject text. 9 ]/ [- E$ C( a2 _& F% q
// The third argument is the email body text. 2 E0 ?! V6 t: J, d- X6 _# H
// The last argument is a user login name as the sender and
0 z- ^9 w* V8 ?2 \) s// if blank will use the logged in user name and , D3 d4 |& q1 T7 N1 Z5 `5 q/ g$ `) d
// that User Item must have an email address as well. % [& U8 z. b. S O
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
- m# @2 k& V. W4 {! dreturn this.newInnovator().newResult("ok"); " F6 M" `" ]9 q8 S9 P0 C
VB.Net
3 q; ?. U$ ^4 W' [, RDim email = New System.Web.Mail.MailMessage()
5 V( Q7 M: O* q" ~& B( G5 g% |! kemail.From = fromEmail
7 h9 y0 O5 l. Q( {8 R' Y! iemail.To = toEmail
. c0 m5 b& M# wemail.Subject = subject
: L5 B* U& r% q/ @# p6 ]email.Body = body
2 R/ ]% ~2 ]; @7 eCCO.Email.setup_smtpmail_server_and_send(email) + }# C% O8 _4 _5 g; o9 T5 b' M2 [
- j1 C' X! w$ X5 K: V) B- U
' Alternatively use the SendEmailToIdentity
+ d) G7 G( f" |8 c' The first argument Is the Identity name To send the email message. & I7 n5 F! U: C, J/ z4 @1 Y& }
' The second argument Is the subject text.
( A0 f% Q6 g& C' The third argument Is the email body text.
9 c4 B* O2 _9 `' The last argument Is a user login name As the sender And
+ Y6 G1 g7 _% H; F1 K$ f) k' If blank will use the logged In user name And
& Q9 k8 S3 w- h( m! l- ]* X' that User Item must have an email address As well.
, k9 X" D; |5 ]# t; D) wCCO.Email.SendEmailToIdentity(identity,subject,body,user) 7 U2 Y+ E7 u+ R+ T+ b- \" `* O, o
* U: m2 U% y- K' d5 _
|
|