|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique / L3 |# g5 \6 w, l1 |% j3 ?, |0 |
Use the CCO.Email object to send email messages.
% r3 E- z! r) q& S7 a6 k3 `5 oC# : U5 L" _; r s' W
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
/ t7 Q0 h. P$ Q( U$ P; W' kemail.From = fromEmail;
; p1 L7 A& |6 {( Y7 B$ X! lemail.To = toEmail; : o2 r/ E5 K6 E8 n; v
email.Subject = subject;
7 \" ]1 }+ t" z- N; V6 }email.Body = body;
& }& T! K& v1 J* uCCO.Email.setup_smtpmail_server_and_send(email);
+ `) z, ]3 ~, d7 w" i / E1 p8 C; f5 L5 A, R/ \
// Alternatively use the SendEmailToIdentity * e' f+ r7 b+ g! t
// The first argument is the Identity name to send the email message. \" l9 t/ B0 ~4 b2 h
// The second argument is the subject text.
/ \/ D% S* |$ A1 S, u// The third argument is the email body text. 0 d- I" a! @( b' D) x- }7 U9 g
// The last argument is a user login name as the sender and 5 `! H" v6 u( _! B( N* n' q t
// if blank will use the logged in user name and
: Q0 R3 F: l9 P3 \' [5 {// that User Item must have an email address as well.
* i4 C" V2 |& z6 [! ]CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ) P" [- e. A) q2 `9 A3 Y/ u- `! @
return this.newInnovator().newResult("ok");
$ t/ C1 L1 L8 v e VB.Net
C1 q4 ]7 i2 [, \' @2 Q7 TDim email = New System.Web.Mail.MailMessage()
+ d( C5 X/ ?4 v6 a+ m& z/ [email.From = fromEmail & m- x, A K! y' L2 q) i& x
email.To = toEmail 9 Y$ ~1 [& f# y" S
email.Subject = subject
/ C0 A! }0 O3 |8 Q$ ^. p7 n! T+ Oemail.Body = body c. h6 m3 c. i9 |/ x) J L5 w3 V. a+ G
CCO.Email.setup_smtpmail_server_and_send(email) 8 `0 k& P# X$ t2 h4 C' t' m
! [1 E6 P h! N6 Y) @
' Alternatively use the SendEmailToIdentity * }& A7 |% z( U1 C. z0 B- H
' The first argument Is the Identity name To send the email message. ; k# o2 f4 t e2 u; ~
' The second argument Is the subject text. + u7 }, w1 k9 x" O4 g
' The third argument Is the email body text.
0 K+ I% V, B [' The last argument Is a user login name As the sender And J/ h8 T6 W O( F) ^! [
' If blank will use the logged In user name And ! Q4 T. B/ V% H$ G4 e
' that User Item must have an email address As well. 1 d/ M# ^6 t/ ~; u9 X, S. B
CCO.Email.SendEmailToIdentity(identity,subject,body,user) " W8 u) o3 K2 c0 S- O. |
9 Q' B/ V4 M3 V9 V. U! T! P5 |& Q
|
|