|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique + f" r" l% S6 O0 c/ b" Q
Use the CCO.Email object to send email messages. 5 Q0 l3 Z" W" y
C# 3 e$ v s$ K$ K# ]' H
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
9 r, ^4 V; p( [* r4 z+ S4 v$ o0 }email.From = fromEmail;
* {! f/ |- L+ O7 kemail.To = toEmail;
0 y5 [1 P% B. Uemail.Subject = subject;
7 Z) \- _- [- t. |, bemail.Body = body;
$ \: o, c- [, `! F+ CCCO.Email.setup_smtpmail_server_and_send(email);
+ \! `7 e5 U& r; S" @! G3 e
8 N& C0 v( p9 ?! b( F+ u6 Z// Alternatively use the SendEmailToIdentity
$ u1 M4 @, m4 e2 t" `// The first argument is the Identity name to send the email message.
" {7 _2 }$ W! ? e; [( U# @// The second argument is the subject text.
$ n% L1 V, n' }+ c# o% a// The third argument is the email body text.
7 C6 u$ @) v% ]- j// The last argument is a user login name as the sender and
2 u) I' o, ^) P6 f+ n' T$ F// if blank will use the logged in user name and ' b+ K0 g% s5 {/ J& x0 Y U; o
// that User Item must have an email address as well.
( s A, V9 {( Q+ n7 J8 ]CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
5 e+ v$ V& R$ l$ Q8 Hreturn this.newInnovator().newResult("ok"); 6 g. v6 j1 t4 O5 m/ k
VB.Net # C% a; D4 p9 C' H# \6 o& E e
Dim email = New System.Web.Mail.MailMessage()
( F" l8 y- U2 T8 n' S4 Xemail.From = fromEmail * P2 V) J# m" [
email.To = toEmail
4 k: m( c! s K yemail.Subject = subject * @% k; i( q) ]; ]! {2 L; n& w% v
email.Body = body
5 j+ E. T3 L8 a* r! z& v" W: m; uCCO.Email.setup_smtpmail_server_and_send(email)
8 V% @6 h3 ~. O4 l; f; K - F4 P* z: p; U! J. L4 I$ m. a$ Q/ x
' Alternatively use the SendEmailToIdentity
0 U9 m$ K) } {9 M' The first argument Is the Identity name To send the email message. + k8 n Q. ^6 g1 R0 n: e) K; T6 b0 J
' The second argument Is the subject text. - S* P8 o. F) A" o) P) M( X
' The third argument Is the email body text.
! l L( W3 r2 B6 a, f6 x4 h' G' The last argument Is a user login name As the sender And $ q Z2 T8 E: ?* C, l2 @. s
' If blank will use the logged In user name And
- L2 s% Y6 D! e* [9 A$ p' that User Item must have an email address As well. / M3 [8 U7 g G
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
, Y7 g4 W' S( b# r( y |
0 E2 a1 n) y$ C5 s/ @4 J$ G8 T, T |
|