|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique " z- p3 b/ n& {0 C2 D% }# b$ A, P
Use the CCO.Email object to send email messages.
4 Q% \$ z' o0 A5 l$ mC#
! A- S. P- I+ u W( H- q$ R" SSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 5 M& G% b) m3 G
email.From = fromEmail;
) k1 x( u: F* c" ^8 H6 s: u, U0 l! _% oemail.To = toEmail;
" O% X! Y5 t6 c4 {email.Subject = subject;
6 x" Y$ J- \# v" G7 Zemail.Body = body;
6 v" O0 c' i% q" d5 C" G; ^CCO.Email.setup_smtpmail_server_and_send(email); - z; _0 p; f4 t3 S0 m* E* E. T1 n
9 M, v) g8 z: `0 ?( |
// Alternatively use the SendEmailToIdentity
0 _* F* e. U! k) k% E5 Z, v- ~* q// The first argument is the Identity name to send the email message. 6 V6 b) c7 M/ k+ Q: w& C, C N
// The second argument is the subject text. 7 g8 j. Y7 S# D0 |
// The third argument is the email body text. * B' }7 k1 \0 e* Q6 g- A: |
// The last argument is a user login name as the sender and
; ]% e" S) x, u9 ], U& ?// if blank will use the logged in user name and
3 p, g( M- ` l$ u: U* ]// that User Item must have an email address as well. ! ]: m3 w( R: y, x, T+ c' r
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
7 k' O: d) ]3 p/ a8 A6 c& ureturn this.newInnovator().newResult("ok");
! W3 }+ j2 Q. x3 V' N! U VB.Net
$ v& y8 O/ c) Z' k! lDim email = New System.Web.Mail.MailMessage() ) b9 u8 c0 g0 F3 u
email.From = fromEmail
( H* D2 ~0 c# q" Qemail.To = toEmail ! C; f8 q1 w# V1 x2 g( l! s# m
email.Subject = subject
+ }2 K* c/ `9 m- E+ _email.Body = body % o) {7 n# P. @8 G$ H8 V" ?. S( s2 a- I
CCO.Email.setup_smtpmail_server_and_send(email)
( h( _8 z" P1 T , t- I9 A O/ f6 P5 z. g+ f" D
' Alternatively use the SendEmailToIdentity 1 i+ I( C3 k9 k# F! _4 W+ ~* {% \, V
' The first argument Is the Identity name To send the email message. 2 q n$ F* r6 y- U& _
' The second argument Is the subject text.
4 C' T0 c8 E% q( e6 b! _. u; Z1 _' The third argument Is the email body text. # S" K8 o( E: V
' The last argument Is a user login name As the sender And
* A& T/ d' h c2 \' If blank will use the logged In user name And
& h1 f) t7 b: G' that User Item must have an email address As well. * V( c( y. v4 E! t3 j& C! v( G
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
* Z! |/ k* z: N. s+ F
. h2 l! f: g5 d! N( s |
|