|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
I; d' `' {7 t b! ]- UUse the CCO.Email object to send email messages.
7 l8 [8 m" S, _& BC# 3 ], p" Y( K+ G" E/ W7 @1 J" N: X4 c
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); # c' N- q S) k) l7 u0 l
email.From = fromEmail;
6 H( N0 I! T( r0 b: d' n7 V7 g3 }email.To = toEmail;
: ]3 _+ W: u# p9 Lemail.Subject = subject; 8 K* C; y, t5 R6 ^* h
email.Body = body;
- z8 ^9 c9 T; `+ y$ d. uCCO.Email.setup_smtpmail_server_and_send(email);
; T) W i+ a2 G2 \5 J5 B- H: }* A / U2 f" r3 G+ e( p% O: R8 l2 v
// Alternatively use the SendEmailToIdentity
0 L! U% V# @4 T6 v! W; j* s1 r// The first argument is the Identity name to send the email message.
$ ?' `; z' H+ z// The second argument is the subject text. . R8 i" `9 ^/ r H+ Q2 V. S
// The third argument is the email body text. 7 P8 V) J$ f- B8 S
// The last argument is a user login name as the sender and
. h1 C' u" x; n6 z B" [1 F3 p* W// if blank will use the logged in user name and $ z! J& J( u; B; {. p6 a
// that User Item must have an email address as well.
% }; R t) k" w4 V e+ BCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 6 b" O- G/ o$ F" Y) k; t( r
return this.newInnovator().newResult("ok");
0 U* v3 E. s1 a- I! x- A VB.Net ( H8 U6 n) X4 f$ m
Dim email = New System.Web.Mail.MailMessage() " o: [/ p6 Z L! {# H4 A
email.From = fromEmail
( w8 v( t' E. E5 pemail.To = toEmail " {2 q, U: S3 b z
email.Subject = subject
$ Y8 T2 ^& x" I+ N# h/ Iemail.Body = body
* R0 a0 p5 N% C0 Q, J" W& `8 R# k; FCCO.Email.setup_smtpmail_server_and_send(email) ( p4 b6 [5 X3 D
! O8 f) m5 w6 e' Alternatively use the SendEmailToIdentity
7 k' }' `8 m- X" F* g& u! A0 {' The first argument Is the Identity name To send the email message.
' p' \0 I5 v1 o Z' The second argument Is the subject text.
% X0 p; H0 O# r" Q' The third argument Is the email body text. % Z* S9 g& R9 C2 x1 e4 I
' The last argument Is a user login name As the sender And # U7 r- L4 C6 ~3 G( x4 q0 {
' If blank will use the logged In user name And ; o2 B1 B* x, ?* \$ l
' that User Item must have an email address As well.
7 U' m$ x9 K) }CCO.Email.SendEmailToIdentity(identity,subject,body,user) 4 p% s; ]: Q0 q, x+ r; E4 D
; @% i) P( a* g* L7 b: F9 ~& ? |
|