|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
$ `) D( q% C K6 N! aUse the CCO.Email object to send email messages. / i0 D; _" H' H4 u/ ?
C#
. T8 M% y) ^7 J5 }- f8 M0 {, }- ~System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); . Q: ?5 A4 X! u4 \' l0 {# Y
email.From = fromEmail;
" C9 m. [2 a) P2 memail.To = toEmail;
. r9 d: }$ d# t% u! I5 _- temail.Subject = subject;
& g6 M! X6 j8 l' n/ z/ W( nemail.Body = body;
5 K# H. I1 L$ z |3 C: B$ c$ P+ a+ aCCO.Email.setup_smtpmail_server_and_send(email);
. N2 |/ O9 ]8 z$ F6 f 9 Y' n- V4 l8 s0 ^+ I
// Alternatively use the SendEmailToIdentity
+ \: _1 c5 [" U; n' W/ V3 `3 q// The first argument is the Identity name to send the email message.
4 H8 @: ?! U4 r// The second argument is the subject text. ' \7 \1 k2 v8 e, t) K8 U1 X
// The third argument is the email body text.
- z1 {0 k$ M$ v+ E5 H( o% O// The last argument is a user login name as the sender and
2 v9 u' b6 a" i" |+ K7 J3 E4 E// if blank will use the logged in user name and
- b! s& V' \/ F9 ?4 s. K// that User Item must have an email address as well. + Y" `) B0 s1 H s# z
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); , J) G2 V/ C) |; t
return this.newInnovator().newResult("ok"); 5 D0 `3 r- B7 T# I: O
VB.Net
4 n0 U1 F V) I0 jDim email = New System.Web.Mail.MailMessage() " C! {5 a4 c2 V0 U% M; q
email.From = fromEmail
+ h& g3 ] M* F0 ^& eemail.To = toEmail 2 A% G; f! u# s/ H* Z# B
email.Subject = subject # j' @1 v3 T5 Z+ y
email.Body = body ( \% a- o) U; j- G0 D; i
CCO.Email.setup_smtpmail_server_and_send(email)
) g/ v" Q! X- n: o8 z8 m : h- N# M/ O- K2 K/ E4 d" B$ G- x
' Alternatively use the SendEmailToIdentity
/ g8 q! B& n" v0 U3 a; p, d9 `' The first argument Is the Identity name To send the email message. ; \! z8 b7 \" i* m+ y
' The second argument Is the subject text.
) c1 R5 E% M( Y- Y' The third argument Is the email body text. - F9 e, {) |+ g- K5 g, a
' The last argument Is a user login name As the sender And ( K( R; `$ E! g" {- i0 q
' If blank will use the logged In user name And
7 l" F& S8 p- B' that User Item must have an email address As well.
5 w. }+ K' T9 S0 L& E! b4 n) yCCO.Email.SendEmailToIdentity(identity,subject,body,user)
& u- W: @+ ?% k8 ]2 ^7 q, r; u; m% U+ G$ F3 S
|
|