|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique + H" C8 g2 _" v" J+ g
Use the CCO.Email object to send email messages.
6 T/ C5 E: a: E- g" [: R) cC#
' u5 h; d+ U9 i% M, [3 bSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
^, V' z+ [. w' ]email.From = fromEmail; 2 b& p# @5 s. ]) z5 ]( i$ I. \
email.To = toEmail;
0 M: h" X2 E7 X/ Femail.Subject = subject; / T% ~) C) c5 ~* P b3 X
email.Body = body; 7 @2 t$ F& u2 ?
CCO.Email.setup_smtpmail_server_and_send(email); 2 I/ Y9 I8 ~: k+ C3 h- X! |7 w- Y- ?
. `# T' D- `4 Z5 W9 y6 @// Alternatively use the SendEmailToIdentity 7 n, F) J4 O7 n
// The first argument is the Identity name to send the email message. / z5 X! Y; S9 H! l9 W2 j. [5 ] k6 Q
// The second argument is the subject text.
6 `& w6 _" {( \; z5 E// The third argument is the email body text.
$ m) x% m; A7 q% e2 `* _// The last argument is a user login name as the sender and
* a1 R8 Q. u. Z1 W( `// if blank will use the logged in user name and
" R+ x. V5 h2 l/ ^// that User Item must have an email address as well. U/ c5 X+ W+ y
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
! G/ C" D0 j8 A2 ]9 [return this.newInnovator().newResult("ok"); ' M c6 S' z. n5 K- G
VB.Net * c: Q B8 }7 o: ~+ J( E# _$ u
Dim email = New System.Web.Mail.MailMessage() / C0 R5 D) k) g$ q2 O
email.From = fromEmail
1 K! A# F& g+ Memail.To = toEmail
" w, e- G& M. E8 z$ h$ Vemail.Subject = subject ) m8 W3 G: r- O+ \& n- m' O' R
email.Body = body
) Q+ a ]; t- |4 A0 K wCCO.Email.setup_smtpmail_server_and_send(email) ! l7 P# g7 U) r# R
6 {! Y2 z/ Z: F- y$ w
' Alternatively use the SendEmailToIdentity
: W+ R1 l. O( y8 x' The first argument Is the Identity name To send the email message. 9 A: b t) O0 g8 n4 M) C3 B
' The second argument Is the subject text.
3 t+ M) q6 m1 a2 p1 m# z. s' The third argument Is the email body text. % J. o! k( ^! Y! ]; `/ Q. W
' The last argument Is a user login name As the sender And
3 L4 B. D/ P% S4 a; ]1 ]0 r3 {1 l! |' If blank will use the logged In user name And
9 y/ _0 m# \) ]- c' that User Item must have an email address As well.
2 c% s2 s1 U7 d6 U% L8 |CCO.Email.SendEmailToIdentity(identity,subject,body,user)
w; s j5 I, a0 Z; G4 e- U$ Y4 L+ U+ q' N; A
|
|