|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
: P& j6 Q% I; q, T* ?7 uUse the CCO.Email object to send email messages. & p! d- W/ @8 ]& e9 L
C#
& F7 }# x" ?5 XSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); & u# q& k0 A/ u! D y
email.From = fromEmail; " h9 t3 J; Q9 E' V& ?! N! S
email.To = toEmail; ' g7 B* N2 U- h) e3 j. @) e9 J' e
email.Subject = subject; 2 I4 P" A8 ^% E3 }6 r1 C7 i) Y
email.Body = body; : D0 \/ f1 I) e8 E, x2 d
CCO.Email.setup_smtpmail_server_and_send(email);
/ h# y9 G, |! \: O& J" ^
! {! ]. T9 n0 L: M& R w' ?" Y5 ?// Alternatively use the SendEmailToIdentity , t, O: e1 i# ^1 G. m9 g/ b1 U' ?2 C: V1 ^
// The first argument is the Identity name to send the email message. 9 k; t% N& I6 v
// The second argument is the subject text.
& u4 Z1 J$ X- S: `/ Y% u// The third argument is the email body text. 6 n7 A* A9 m( T. ?& M0 d: T
// The last argument is a user login name as the sender and ) m( |9 b& t# n2 z) G) M
// if blank will use the logged in user name and 1 S5 ?; f/ l4 y7 F" g' n& P' {, y
// that User Item must have an email address as well. 7 B: v2 U G5 ^* E
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
& o' o7 }( _0 S8 @4 w' treturn this.newInnovator().newResult("ok"); ) R. V& y; Y/ |! @8 v
VB.Net : U0 k! ?. l* c( Q3 u1 n4 ~
Dim email = New System.Web.Mail.MailMessage()
# S# D/ x: l7 i' e3 s0 Vemail.From = fromEmail
; N3 P( @7 L* ?email.To = toEmail
) j' s5 Q. ?' H1 I, iemail.Subject = subject # x' f8 N0 I$ ~( R/ m3 f# K: {
email.Body = body
1 \! l+ E; N. K: F- nCCO.Email.setup_smtpmail_server_and_send(email) . ]2 Y6 H ^8 x. @6 M+ Z
+ _2 D a* ~& k) j6 m' Alternatively use the SendEmailToIdentity
, w# \* F: O6 E% C9 e3 U+ y' The first argument Is the Identity name To send the email message.
2 h3 S( U2 P3 _* }8 @5 z8 Q' The second argument Is the subject text.
' O0 e+ Z- h; w q' The third argument Is the email body text. " M. G" L) ?$ j2 Z) v* }: I9 s n+ B
' The last argument Is a user login name As the sender And
2 o* H! L) D% e# ?9 M' If blank will use the logged In user name And
3 F6 ^4 |' }3 x( u' that User Item must have an email address As well.
A' }* }( Z0 T+ y- Z% ]CCO.Email.SendEmailToIdentity(identity,subject,body,user) + u0 X0 F* o% p T) I9 V: B
7 h$ J+ i, |& s, g c% B |
|