|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique : v& y$ w# U: U) t( |
Use the CCO.Email object to send email messages.
6 R+ |5 U+ ~$ U: L+ u, DC# 5 \# \4 w) G9 n5 G! h8 @0 @
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
/ W# ~0 `6 y* x: O% `6 \# hemail.From = fromEmail; % E7 @+ h- p8 P3 q0 K! h
email.To = toEmail; 1 z7 L( J% W9 c( ~
email.Subject = subject;
8 E! T6 C% t4 L1 eemail.Body = body;
( l0 N O; W8 p! ] Q+ M3 M0 kCCO.Email.setup_smtpmail_server_and_send(email);
, n4 s0 r: i6 `$ }+ S2 d3 [2 w4 @ ) O! D" o' @6 r7 M
// Alternatively use the SendEmailToIdentity ' @4 B# a9 Z- f* [- A: E4 A- y
// The first argument is the Identity name to send the email message.
- S& r p" {4 {7 y3 s' g// The second argument is the subject text. , |# @$ o( `. r! i3 ]1 P! U
// The third argument is the email body text. 0 g0 j+ V4 o6 [3 }
// The last argument is a user login name as the sender and * I" M9 W2 Y4 t- b9 F' k
// if blank will use the logged in user name and
; b, F2 R1 t7 S+ R# F7 z// that User Item must have an email address as well. 2 V$ c& a8 _) |+ K
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
2 X( S+ w. O" r4 h* g& lreturn this.newInnovator().newResult("ok");
$ W- r# |" ~/ w: Y5 o VB.Net % X$ m5 m$ D* u/ x5 t) i2 g# _
Dim email = New System.Web.Mail.MailMessage()
4 r& v! m% Z0 Q& z) t+ ^/ vemail.From = fromEmail
o9 W6 K0 `( ^, Bemail.To = toEmail
& C3 Z3 x* M- H/ v! z) Semail.Subject = subject ) T u o8 f" U% A$ Z; j) }
email.Body = body
. V0 k. ~( h( d- CCCO.Email.setup_smtpmail_server_and_send(email) . x0 f+ E! @. m* _
6 [. U( @; T4 E5 a, i
' Alternatively use the SendEmailToIdentity # Z9 U' e0 M' k4 Y" X# e
' The first argument Is the Identity name To send the email message.
6 w: q/ y a* E' The second argument Is the subject text.
* H5 `6 b7 b0 T6 _' The third argument Is the email body text. : h* s7 n+ m* ~5 D# A$ m
' The last argument Is a user login name As the sender And
0 v b3 p( ~' W, G7 @6 B' If blank will use the logged In user name And
2 J6 b8 t' P3 s8 e' that User Item must have an email address As well.
* O5 N- P* Q' zCCO.Email.SendEmailToIdentity(identity,subject,body,user) ; t) n$ `5 b6 [6 m$ n7 ?1 t% d
) l+ ?+ P9 m; Q' t* d
|
|