|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique , @) A! R# ?) n8 o& n5 Z
Use the CCO.Email object to send email messages. * D. w9 O. C& L
C# * ~7 |- ~' X1 E& g% ?
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
e4 F& o, A8 T' y) V1 pemail.From = fromEmail; 6 h3 w6 M6 A- U& Z. ^: s* p# Y0 E
email.To = toEmail;
& G: ~& j' Q2 S1 \- ~; M8 ?9 z/ lemail.Subject = subject; + R! e( V% V+ C2 ?) N
email.Body = body; ' i( W0 M7 c: F1 \6 `
CCO.Email.setup_smtpmail_server_and_send(email); 4 w' F/ o5 A# T9 O/ s2 [+ Y
! i6 n. }/ c: L/ {// Alternatively use the SendEmailToIdentity
. A6 {5 v% U4 d// The first argument is the Identity name to send the email message.
+ J# a$ q1 u5 L// The second argument is the subject text. * ]/ p1 a! K* e4 h( O/ ~& Q+ c) a
// The third argument is the email body text. , G: H7 K) j6 @4 O
// The last argument is a user login name as the sender and ' H% ]& r7 A* g$ U
// if blank will use the logged in user name and
% M) S, V( @; i) {/ x8 L3 i! i7 e- w// that User Item must have an email address as well. : i5 \0 Q9 Z/ G. }- [$ \/ g
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ' A+ d4 `* P! \6 r: }9 t6 z5 H: u
return this.newInnovator().newResult("ok"); / ]3 u0 z0 N2 O9 y, \
VB.Net
; t) Z7 h* w5 z- a. n+ @7 GDim email = New System.Web.Mail.MailMessage()
8 F, q3 I u- ?- s3 aemail.From = fromEmail " C: |9 }% T, o8 W( D* K
email.To = toEmail 8 r, r& P3 d( @4 P
email.Subject = subject
9 |9 A, |6 ] d/ J& Remail.Body = body / j- Z7 {1 Q/ q f1 N+ E
CCO.Email.setup_smtpmail_server_and_send(email) 3 h3 x" X5 s8 b
! B) c2 N, ~* S( z- P- J9 M' Alternatively use the SendEmailToIdentity
, n2 M. n+ V" f7 Z' The first argument Is the Identity name To send the email message. 1 K+ \+ i* v. m% ^! v
' The second argument Is the subject text. , |6 L6 J) H/ F5 a
' The third argument Is the email body text. ( p' [ Q; r- F2 V- D4 V
' The last argument Is a user login name As the sender And
9 j, y8 T/ A# P: Q) i3 e8 M' If blank will use the logged In user name And
: z" B5 v A6 G8 Q7 E. B' that User Item must have an email address As well.
8 b! A z: p: bCCO.Email.SendEmailToIdentity(identity,subject,body,user)
- q* f/ T7 w0 E" e- `0 e0 l, A0 W! ~+ }* P0 v
|
|