|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
4 }( n' @: Z. HUse the CCO.Email object to send email messages.
8 g. [8 N7 `9 V! }C# 3 s( g# Y! u5 Q
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& v0 c$ t" F6 v, H- j' `email.From = fromEmail; / T' t: M* H/ h+ J) ~" I) }
email.To = toEmail; / n: k/ D+ {" m. m
email.Subject = subject;
9 R4 x1 R+ z' X& M' G' ~email.Body = body; 1 p8 e L# k+ W \6 O0 ]
CCO.Email.setup_smtpmail_server_and_send(email);
3 G% Y. W; M9 N* t6 E6 Q% M
% N/ S M) h6 O$ i3 V6 T& _" O// Alternatively use the SendEmailToIdentity ( Z. x8 u: u4 y+ ]2 [4 L# `
// The first argument is the Identity name to send the email message. 6 A) D y* C |
// The second argument is the subject text.
9 S' j! p% z$ {& [* c* h// The third argument is the email body text.
4 q% i" ]) l; z4 x+ F7 N7 A; N; Y, N// The last argument is a user login name as the sender and 8 x7 ~4 y8 i' H# u; h: L
// if blank will use the logged in user name and 9 V2 L; t$ o" C( j6 D9 m, f" [
// that User Item must have an email address as well.
0 r5 w) E1 j _7 ]" nCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
4 n* U% U: M+ J) q; g$ Y4 X8 Hreturn this.newInnovator().newResult("ok");
8 A7 K& X; T9 m' x4 W( ? VB.Net & z0 }: _7 T% e. e9 b, D: D. Z
Dim email = New System.Web.Mail.MailMessage() " p3 ?0 v' s" P5 F0 T! |) E
email.From = fromEmail 3 h2 k% M9 g7 w, u3 {- ^$ [" D
email.To = toEmail 7 v4 m1 G& i4 W" W
email.Subject = subject
# R* V+ r- N9 A- a/ wemail.Body = body
. l3 k$ m* ~" U ~% Z' H xCCO.Email.setup_smtpmail_server_and_send(email) ( y( q" `. ?5 r0 `' Z. ]4 X' \
) m; e1 ?% |, ~3 @1 u' Alternatively use the SendEmailToIdentity
- i8 F. k8 Q: V; c' The first argument Is the Identity name To send the email message.
4 j4 g8 _1 C# n! |+ |/ a' S6 B' The second argument Is the subject text. 3 t* {$ d I! p3 O% {3 H% B
' The third argument Is the email body text. + _2 U/ g- V- c8 z. }& t3 W
' The last argument Is a user login name As the sender And
0 H5 T7 [. l8 h$ L7 {! M! U' If blank will use the logged In user name And ' ^, w* E% e* a" ~. E/ f
' that User Item must have an email address As well.
+ j8 x& _1 v7 e! CCCO.Email.SendEmailToIdentity(identity,subject,body,user) + |% T O9 H9 e$ K0 C
/ h* T3 d m3 ]% o0 i* F" I+ }6 q" q |
|