|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
3 g# T! x& ^/ \Use the CCO.Email object to send email messages. * g0 N' ]* S7 Z1 F3 y
C#
, }) _+ p/ }2 k7 w9 M/ iSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
( Z: x, A' J3 N4 n4 nemail.From = fromEmail;
$ U7 U4 Z$ \2 Q9 g F/ G: Wemail.To = toEmail; 2 N* a7 k4 x( g$ z/ l+ O4 G
email.Subject = subject; $ _5 q5 c- R7 n C2 I
email.Body = body; % D0 s( Y% f p$ V
CCO.Email.setup_smtpmail_server_and_send(email); $ X; k2 w' m; k0 _$ A0 ^
; c9 T9 d) q6 x7 ?$ E( |7 r
// Alternatively use the SendEmailToIdentity ) R4 O0 \+ @7 U, @$ l
// The first argument is the Identity name to send the email message. # h) W/ X/ ~4 c! I; r) P/ S
// The second argument is the subject text.
/ h; K. d# h3 d// The third argument is the email body text. 4 _) }5 w( w+ _% h3 a8 z
// The last argument is a user login name as the sender and * a* k8 e+ O) n8 ?
// if blank will use the logged in user name and
1 r5 d/ U, N7 a( Y) n5 O// that User Item must have an email address as well.
9 w+ `# _1 @: N- ECCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
8 [1 j4 y4 c8 i3 N A+ Yreturn this.newInnovator().newResult("ok"); & y$ R5 D5 Z/ Z/ i5 B7 L u e
VB.Net ( O6 L J' m( Y" l! @- Z8 O5 J& U( g
Dim email = New System.Web.Mail.MailMessage()
5 M: D3 \. ~% o- q; U D8 iemail.From = fromEmail
4 i" W1 G y7 C- p1 Lemail.To = toEmail
6 `0 Z) x v2 }email.Subject = subject # |( a" z1 q* R# J
email.Body = body
+ S/ v' p# @7 Z! _9 h' yCCO.Email.setup_smtpmail_server_and_send(email) ( g, N/ S* ]9 Z$ k$ c6 g
[2 [* j- {! r7 ^9 {, P: `1 X7 F' Alternatively use the SendEmailToIdentity
* V* I) ?/ D+ o. m6 }" \6 M' The first argument Is the Identity name To send the email message. * |: X* k+ w; Q! K
' The second argument Is the subject text.
6 ?$ K+ F4 A3 @7 ^( ]' The third argument Is the email body text.
8 n, ^) t/ y8 K, A+ x- Y' The last argument Is a user login name As the sender And
3 T a, K5 c* }' If blank will use the logged In user name And ; u7 T% d8 R- @4 l, \& I% U
' that User Item must have an email address As well.
1 r. o; m5 ]4 u- R& J5 [CCO.Email.SendEmailToIdentity(identity,subject,body,user)
( ~5 D8 t& c$ q( t- d! s. v1 L+ L E# N! M
|
|