|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 4 o/ R8 z- U/ H' A' }! l
Use the CCO.Email object to send email messages. , t& g' w% I& q
C#
2 E1 M# o# p ? @% aSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); + ?# [, e6 v0 l2 R- Q
email.From = fromEmail; " `2 D8 F% q) `) e
email.To = toEmail; |6 T; |9 M5 |0 }5 C; c P
email.Subject = subject; # ^+ }7 e1 a4 {4 m, |* E4 N% V
email.Body = body; + A( j4 A- X% v1 b6 n9 d
CCO.Email.setup_smtpmail_server_and_send(email);
, _& t, ]* x' A. A/ h' d
/ Y' @( v- Z; b4 i G1 C- n// Alternatively use the SendEmailToIdentity
# J$ Z) s2 L& y// The first argument is the Identity name to send the email message.
# g. P6 D r4 I7 Z/ K" p// The second argument is the subject text. 2 R( D' l' u8 [0 a; p9 e9 v
// The third argument is the email body text. 5 Q2 j/ s) `2 `6 u
// The last argument is a user login name as the sender and
8 A0 t, o* C8 x% _* c* A// if blank will use the logged in user name and
3 A0 V) N P' S% s4 d# o// that User Item must have an email address as well. ' V% d0 x6 ~& l* L" G/ `+ E- ]
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
5 {$ I7 I4 s0 d/ Ereturn this.newInnovator().newResult("ok");
$ c' |. r4 h" O0 B- V VB.Net 4 t0 l! s1 H8 k1 k1 m$ o
Dim email = New System.Web.Mail.MailMessage() 1 x9 Y+ H: Q2 }; I
email.From = fromEmail
( A( B( p! _$ S2 h. m6 ~email.To = toEmail & a$ C- _( l W* r/ a) i
email.Subject = subject
, e; b2 a0 y7 G/ H; \" Lemail.Body = body
9 t1 y n1 q& `3 [. v, b E% xCCO.Email.setup_smtpmail_server_and_send(email) 4 Y2 P% b( U. n* `; E |
5 H; S/ s w: N n6 p
' Alternatively use the SendEmailToIdentity , Z5 P, f1 F7 z4 m8 x1 `9 m% f7 A
' The first argument Is the Identity name To send the email message.
0 q2 y' H3 P/ t* F1 b! R' The second argument Is the subject text. ' R1 u% W9 V3 j+ `: G t; i
' The third argument Is the email body text.
0 i( C: y' G2 B8 w. U0 E. f' The last argument Is a user login name As the sender And - n4 u3 B5 \% U
' If blank will use the logged In user name And % J4 S* B) G9 O- ~6 Y ^7 o
' that User Item must have an email address As well.
4 F' l/ U) |/ L7 Z2 W6 N! JCCO.Email.SendEmailToIdentity(identity,subject,body,user) & H0 G8 ~( {) }9 A9 @" e0 X( B7 _
5 l S+ t0 x. y$ E, Z) y H: R
|
|