|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
. U7 K8 N% m7 o; ?Use the CCO.Email object to send email messages.
7 L" P; A: Y2 E) {$ IC#
$ v1 C- L, }* |$ \6 tSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ! N4 o5 L8 y1 H5 J
email.From = fromEmail;
6 t9 }# P% G0 I1 k$ a; X1 |3 O7 qemail.To = toEmail; . s$ d; B4 M# }* w4 r; @
email.Subject = subject; 0 ]% J C+ K: G- O7 a4 o) z: j
email.Body = body; # Z5 u, M$ ?& |
CCO.Email.setup_smtpmail_server_and_send(email);
6 r7 [1 S/ k0 I: F3 B* U" A% k ! R% [2 t1 [/ m/ Y: V
// Alternatively use the SendEmailToIdentity
7 G- H) ?. ^' T. N7 ^! |- l// The first argument is the Identity name to send the email message. % {# V5 Q. [! R* i) w6 h% k/ `4 W9 S
// The second argument is the subject text. ; K- d$ E% j# n4 i, X y4 V' g
// The third argument is the email body text. " X/ q/ v& X; t& T$ k4 T4 J
// The last argument is a user login name as the sender and b; I, A1 G1 a% H
// if blank will use the logged in user name and
T3 l! S. f. }* l) B- m// that User Item must have an email address as well. 0 f' g: S8 M2 O; g. h; ~( r
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
: C& p) Q# w u8 M: Lreturn this.newInnovator().newResult("ok");
7 l7 w1 C$ g6 \# o VB.Net 7 p {7 [4 N- L' E6 L1 Q
Dim email = New System.Web.Mail.MailMessage() 6 Z( N9 ~4 D& k
email.From = fromEmail * ?) l0 \( G& J
email.To = toEmail
, a0 k8 y. e3 ^2 |email.Subject = subject
/ V9 I) A' _) L1 K+ eemail.Body = body
" ~3 z4 m4 a. |; k, j" P; O; Y {6 XCCO.Email.setup_smtpmail_server_and_send(email)
0 J8 M- G9 \! d( c7 Z
" O$ Q6 f# T3 o4 O# @; a+ ^' Alternatively use the SendEmailToIdentity & I8 q8 w: Q5 n: Z/ H2 @
' The first argument Is the Identity name To send the email message.
7 x9 L! r) j2 v' The second argument Is the subject text. 1 P- A: L. \+ Y& _; Q
' The third argument Is the email body text.
4 B/ {; o2 w1 L' c" w5 a' The last argument Is a user login name As the sender And & a! f, S6 M" Y/ s! i1 |' r
' If blank will use the logged In user name And
: U9 S' T7 U; x" N6 v0 k' that User Item must have an email address As well.
* e3 c- z) ~ D4 ^* i# r9 ACCO.Email.SendEmailToIdentity(identity,subject,body,user)
) }- p3 _& A! z. N1 T7 t
5 w4 d) [& N- Q; U D8 j |
|