|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
8 c$ t) ^% y+ J/ f) qUse the CCO.Email object to send email messages. ( J# t1 n L6 R# y$ X7 ?
C#
7 r" |6 ~, R3 ^5 _5 R; ESystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 4 C' h7 d3 d& L. a7 f
email.From = fromEmail;
. h9 \1 i( R& semail.To = toEmail; 1 a% b/ f! U: J3 s
email.Subject = subject; 8 C! D" u* B. r4 U" h( N$ Y
email.Body = body; . b) [0 E$ A) o' M) H
CCO.Email.setup_smtpmail_server_and_send(email); 9 @. B5 I& e/ P( E( E0 \2 d' G `5 w
' H0 v. O2 f3 Q3 i! ~
// Alternatively use the SendEmailToIdentity
8 R! C' Q- h: } a// The first argument is the Identity name to send the email message.
2 Q" \/ R {9 H7 H: b( F' l// The second argument is the subject text.
+ H" P: W* G, _. u2 M3 i; b// The third argument is the email body text.
1 B& g# o# A/ |9 Y3 y; H( m: Y7 O// The last argument is a user login name as the sender and
2 @4 i2 l% m* O& [- T0 \: ~// if blank will use the logged in user name and # j& b) X" T7 a
// that User Item must have an email address as well. : I" P U3 L% N; i- p4 c
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
, o! g" f6 R6 E, v7 H' ?8 vreturn this.newInnovator().newResult("ok");
% i( t& p8 @+ l: W3 E$ h, t. n& t VB.Net
6 X7 n9 {8 ?0 ODim email = New System.Web.Mail.MailMessage()
( K: I |) ]. ~2 r J) S! Qemail.From = fromEmail
+ w* N; h* I) w. P" G: ^+ L: n) ~email.To = toEmail
7 r# _, X( j; f( ?3 F+ t: m$ cemail.Subject = subject . v. d2 C; N* z
email.Body = body 9 a% }/ f6 f7 y. }! }
CCO.Email.setup_smtpmail_server_and_send(email) 2 t& o. I2 a; Y( z( `; i
% e# @9 O+ k, |9 S
' Alternatively use the SendEmailToIdentity
y5 B9 n+ _0 b0 ]/ k+ o' The first argument Is the Identity name To send the email message.
! z% ~) D: `! [" p' The second argument Is the subject text. 5 J6 B" T5 I; b' I
' The third argument Is the email body text.
& F8 o) b! w0 _. B( D' The last argument Is a user login name As the sender And
. U1 Y- ]* w- [' If blank will use the logged In user name And & Y# l+ ]$ Y2 j D( G
' that User Item must have an email address As well.
6 U6 v5 O9 {/ s% b/ b3 O$ E2 E" s& i( GCCO.Email.SendEmailToIdentity(identity,subject,body,user) & [2 U: N" i: @( k7 d
7 R% X$ c4 w9 q% c( B/ S; B( n
|
|