|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 0 |4 P5 b a' I8 v
Use the CCO.Email object to send email messages. . ^4 h- N( i( F; e! s8 z% o
C# 2 H' _2 C2 f6 x; U
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 0 x2 ]% @9 F2 G" Q
email.From = fromEmail;
0 ?1 G% E" B: Femail.To = toEmail; 0 L1 n! t1 Q3 R6 V) S/ p7 [
email.Subject = subject;
1 \' A( @& E, V+ i/ T1 M1 _email.Body = body;
+ w6 q. \7 ^% n, G, Q8 jCCO.Email.setup_smtpmail_server_and_send(email);
) h* A- ?$ w7 Q; D5 [; R
$ C1 g' r$ H% C// Alternatively use the SendEmailToIdentity 8 M6 z, a; A0 R6 z5 P
// The first argument is the Identity name to send the email message. 9 _# b% B/ {. V, V+ L+ z
// The second argument is the subject text. * j0 T+ H) u) w
// The third argument is the email body text.
$ K9 M2 e7 R8 }6 d `& X" q// The last argument is a user login name as the sender and
+ E( U( u2 U8 [6 B" Q( x' j// if blank will use the logged in user name and
2 ~4 H; Z' R) M// that User Item must have an email address as well.
: }, y6 p5 @% h' \CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
; N$ C- }( \ [) A4 A1 q0 N( Qreturn this.newInnovator().newResult("ok");
: ^" N, \( {, Q5 v( w VB.Net 2 c/ |& B" P# ?
Dim email = New System.Web.Mail.MailMessage() % ?: e9 H5 b& r' s _5 D) M
email.From = fromEmail
8 x& m9 Y0 R2 hemail.To = toEmail
9 i' D1 Y# i) E4 Y2 ]: v9 uemail.Subject = subject 2 O8 L, b0 P& s* R3 e6 D; r/ {- p
email.Body = body
2 F6 Q& \2 @0 _, P# L9 J8 V" `CCO.Email.setup_smtpmail_server_and_send(email)
0 s2 l+ P7 D8 o# N/ z/ Y. J) N* B8 Y
/ E' k2 I8 ~/ n4 L) E' Alternatively use the SendEmailToIdentity 7 `" l0 W; ?& B
' The first argument Is the Identity name To send the email message.
* ]9 c8 r& f" j2 P0 w1 i- G' The second argument Is the subject text. e" X0 z1 C( }1 ]% g/ T
' The third argument Is the email body text.
2 u; u& u' e* b9 n+ ?' The last argument Is a user login name As the sender And , |; `0 ]3 c {
' If blank will use the logged In user name And
5 Q8 s! t& e, q6 S3 p9 r' that User Item must have an email address As well.
' O1 {# d( ?5 m* oCCO.Email.SendEmailToIdentity(identity,subject,body,user)
& ^7 H2 ^- }, c' f' d+ q: x5 d, ?; E% O( y4 [
|
|