|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
' f/ q: [3 ~" `4 hUse the CCO.Email object to send email messages. R% t* f- S2 s8 O: f
C#
2 {( [! H. C( }* J" x! mSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
% B/ G" L, y+ E+ s; K: f0 nemail.From = fromEmail; " S4 O& C& S M* j U! S- d7 {6 `6 c
email.To = toEmail; 9 L; A, U% [! }8 G) w
email.Subject = subject; 7 a" v9 L6 _, t, b5 I8 ?% ]
email.Body = body; 3 r! s6 T* x- _/ B! |( O
CCO.Email.setup_smtpmail_server_and_send(email);
. x3 F, E5 O+ Y& y0 O& o/ r
7 r+ `) t2 ^& A5 v9 S// Alternatively use the SendEmailToIdentity
8 j: y) r8 [ }( E// The first argument is the Identity name to send the email message.
: @9 J( ?9 u3 P' A// The second argument is the subject text.
+ }' X- ~* s5 c n5 g0 g, N& X3 W// The third argument is the email body text. 6 u- i# _9 C! j4 K! ~2 T* |
// The last argument is a user login name as the sender and , ]( B8 g3 v" [7 i
// if blank will use the logged in user name and
$ D5 {9 v# h s: C5 r% W( a// that User Item must have an email address as well.
; n' ~' W; w" d$ [" _: C5 ~CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
' c& v0 u! y* p' Z9 m& m5 zreturn this.newInnovator().newResult("ok"); 5 m9 J4 {5 s4 P7 ?
VB.Net & }* P5 k' L! y+ }+ Z* d+ o1 G
Dim email = New System.Web.Mail.MailMessage() - @; m- ^3 o( O# j* l$ Y
email.From = fromEmail
* Y6 b1 }+ P, C gemail.To = toEmail
+ r" d2 R* r# a7 cemail.Subject = subject
- j9 b7 u# M. ]5 | M Aemail.Body = body , B- g- }8 G# |% ~0 m T9 I' U! K) M
CCO.Email.setup_smtpmail_server_and_send(email) , ]' a4 S: _4 p) z) f
' c R$ L( z; k: S2 M
' Alternatively use the SendEmailToIdentity + h6 `3 O0 r; g
' The first argument Is the Identity name To send the email message.
' R$ t$ p9 ~6 K! z+ s& a# d' The second argument Is the subject text.
2 p p, J3 O- w5 N* x" U% i( ?' The third argument Is the email body text.
' g: l$ N7 e8 z+ f: @+ x% \' The last argument Is a user login name As the sender And
" X- i1 l: ~" j3 N) J% O' If blank will use the logged In user name And 4 J. b# t D# t
' that User Item must have an email address As well. 9 _! U+ w- G" r2 }; L4 B
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
& s J i/ T) S, n+ |7 Q1 ]8 L
1 v5 D! r+ B5 p: z% c+ N0 t |
|