|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique ) Q! ?5 k- T6 _7 ]( Z" o
Use the CCO.Email object to send email messages. & X3 ^- F3 r$ p0 v4 D
C# 2 n$ }& u5 w; @ P0 {/ R
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
3 D, O7 C: M* j5 semail.From = fromEmail;
9 A6 c- |6 Q7 A* H7 u/ m9 b6 Oemail.To = toEmail; k' i5 t- ]* T8 @' g! ^4 Y
email.Subject = subject; : P% I% _% ?5 G. L! w
email.Body = body; * }% P- K/ n' A# m0 |1 X9 r% g, Y
CCO.Email.setup_smtpmail_server_and_send(email);
; S5 S; L% j& o 0 K+ L# W( |) G1 A' U8 P1 y
// Alternatively use the SendEmailToIdentity 5 `) i2 z. C2 e
// The first argument is the Identity name to send the email message. " k7 a& z) \8 V# F/ t
// The second argument is the subject text.
7 Y v% L8 A% B2 S% Z6 O+ K// The third argument is the email body text. % ]5 j7 f: B5 A4 {. K' d8 |2 F
// The last argument is a user login name as the sender and , Y) K! d* n: }4 c" y$ k
// if blank will use the logged in user name and * V8 Z# ]* W p8 ^/ Q, b* N
// that User Item must have an email address as well.
& c' T, Z8 z) M3 k1 MCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ! i5 W* |6 Z2 i) i5 b
return this.newInnovator().newResult("ok"); 6 Y5 m' u; g# Q6 _
VB.Net " E' }1 C1 A& f
Dim email = New System.Web.Mail.MailMessage() 9 \7 |% ?' }: d+ _6 M9 d5 z
email.From = fromEmail 2 D" _& ~4 u0 c, J$ h
email.To = toEmail % e; |" ~" r0 N
email.Subject = subject 5 f1 s: J ?/ n# X }
email.Body = body % N; ~, S4 W. u) l, ~1 }
CCO.Email.setup_smtpmail_server_and_send(email) / c% K7 @! ~& e* Y- |2 b4 N
) h: {) I; O2 j& }6 p$ ]8 S' Alternatively use the SendEmailToIdentity - |; `$ _' d; R7 h9 X
' The first argument Is the Identity name To send the email message.
9 Q" A$ _8 D m, V5 `+ S: ^' The second argument Is the subject text. + g* f& r `1 K4 y( `2 B7 ], C6 n" g; y
' The third argument Is the email body text. : G- h) b6 N6 a) i
' The last argument Is a user login name As the sender And : y& A. e) m4 l) ~- u. M4 o! y
' If blank will use the logged In user name And " X! t5 O, C! J$ f+ y
' that User Item must have an email address As well. 3 {- k0 q: y# ^3 h0 O" O, ?
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
* M* z% z" ~. x" P! _, C6 l, L( C, H" G2 g7 q
|
|