|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique , V7 Z! B# V6 t3 j. W$ R8 w
Use the CCO.Email object to send email messages.
* i Q6 V; E4 _C# ; Y+ i2 o' u# N
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
4 `9 b2 ^% y9 \5 _email.From = fromEmail; % O. b$ O2 x% B6 w# v/ U1 f
email.To = toEmail;
/ Z, g$ } D$ N7 X/ l- \9 Jemail.Subject = subject; 3 Y( f# t( n; y/ m: Y
email.Body = body; . ~" m$ _, W. \9 V; G0 z
CCO.Email.setup_smtpmail_server_and_send(email);
( O9 P* O9 U) v3 n; @4 A8 R
1 Q) h) e4 n% f [7 M. Z) {// Alternatively use the SendEmailToIdentity
8 [' V6 O- E3 l6 L// The first argument is the Identity name to send the email message. # f( R: w- }2 e5 y. K/ S' J! p
// The second argument is the subject text. - B, T6 i7 Q! Q; K. Y2 w5 a0 \' j
// The third argument is the email body text.
5 c' r' e! M4 G* x* z$ }// The last argument is a user login name as the sender and 6 ]! G4 ~$ d0 o
// if blank will use the logged in user name and
9 i" ?8 F3 N$ F3 M// that User Item must have an email address as well. 6 a9 M7 J8 O9 Q- u2 o
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); . w8 T5 z' { ]# f+ m# c
return this.newInnovator().newResult("ok");
3 h; y- ]0 Y2 g, B VB.Net
8 D5 Q8 A. a2 ZDim email = New System.Web.Mail.MailMessage()
9 R6 v5 C% t. R7 Remail.From = fromEmail / d) ^, m$ p6 H3 w! Z8 C
email.To = toEmail
9 o1 l* B) I. H# ]email.Subject = subject
: Q8 g3 \1 w* d+ m3 l4 L3 Zemail.Body = body & c0 [9 A1 T7 T3 W* X
CCO.Email.setup_smtpmail_server_and_send(email)
" k% E7 T8 u1 D2 ^# H S $ r# ~5 P6 _: }5 H5 @1 d
' Alternatively use the SendEmailToIdentity # Y- d* F! y- M1 a
' The first argument Is the Identity name To send the email message.
l, a& I/ G9 J% |5 R4 I' The second argument Is the subject text.
" I. G; X$ k+ S; u6 q2 z! O' The third argument Is the email body text.
& q7 x1 R6 W. n1 K3 O' The last argument Is a user login name As the sender And
2 Y1 m0 V& }2 o* J) e' If blank will use the logged In user name And / Q r3 E) @9 K% j; o
' that User Item must have an email address As well.
( d. r9 c! G7 _# h9 ?! iCCO.Email.SendEmailToIdentity(identity,subject,body,user)
X3 v0 I. n6 w v; Q% ?4 k/ ?2 b6 V+ u3 n8 \( j% t' M8 A9 X, C# Q
|
|