|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 5 g; B4 z: ^# }" v
Use the CCO.Email object to send email messages. _# @: o8 ]( p4 ~) V' q- ~
C# * q' q5 ^% v) p& f- T/ j
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
' Q9 n$ F" T, jemail.From = fromEmail; . i$ c& D0 q8 v7 D/ r' }
email.To = toEmail; ; a8 T1 f; y2 J+ t1 h8 B9 E1 e
email.Subject = subject; ( N8 X' F0 N ^( U, u# d; L# _5 v
email.Body = body; , t$ o6 V) k) q. ?- {! J
CCO.Email.setup_smtpmail_server_and_send(email);
$ f, D* Z; I; C6 C% K ; P- V5 O9 g6 z! I7 }
// Alternatively use the SendEmailToIdentity 8 s$ w# N; N! d) e2 b9 i6 F% m2 v
// The first argument is the Identity name to send the email message.
s( O/ _" z% t1 Z+ u! @% y8 C L// The second argument is the subject text.
: k' B K" W2 }( P& ]. ~// The third argument is the email body text. 5 Y2 r* c* p% a+ k& D9 A. a8 G" t5 m
// The last argument is a user login name as the sender and
. K& `/ X' r* k- s; ~: a2 l// if blank will use the logged in user name and ) x$ J# O+ t2 S3 `+ w3 y; D& P
// that User Item must have an email address as well. & g; V' N; R% S) w- n& Z5 T1 W, f
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); " g* s% q8 {0 z% ^- K
return this.newInnovator().newResult("ok");
6 i7 c. u6 ^' |9 H! v7 s- ~ VB.Net ' c; a1 i& S6 l% C4 o/ S! u6 P
Dim email = New System.Web.Mail.MailMessage()
% H* n( z0 v" N) e; `* r" iemail.From = fromEmail
6 w& |3 n* a3 ^- x3 k k2 g0 ?email.To = toEmail
" M4 }7 a. c* o/ Zemail.Subject = subject ; Y! Z! y' s3 l0 ^4 s
email.Body = body * Q5 i8 s) z |* k. E$ C
CCO.Email.setup_smtpmail_server_and_send(email)
0 j# K! A3 k; P( _3 S Y
y0 _: a0 G0 q+ I+ m' Alternatively use the SendEmailToIdentity ) F2 ^5 D; G, I' c' S1 P) o
' The first argument Is the Identity name To send the email message.
; m! I7 l/ n6 A8 b5 c& B' q: J' The second argument Is the subject text.
& P5 \5 ?' l. o8 E0 N' The third argument Is the email body text. / c$ b+ ]; H( X, I% v& |
' The last argument Is a user login name As the sender And 7 s0 ~0 V( Y$ t
' If blank will use the logged In user name And
! M& S+ o) Q' }' g S5 a' that User Item must have an email address As well. 3 P" L+ q/ K! y% f' T! J
CCO.Email.SendEmailToIdentity(identity,subject,body,user) ( S/ A% D8 Q; \6 {- W
) Q" k9 o+ x, ?, I" _
|
|