|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 1 x. ~4 f. ?8 D9 X
Use the CCO.Email object to send email messages. / A; M+ p7 Y8 n; h
C#
4 L- p9 F. Y' z$ I6 \System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ) A5 N. Y S; }! e
email.From = fromEmail; . x5 U2 a, v' \4 J% B0 Y o& d
email.To = toEmail; ! [+ q1 X" v9 p% C8 u
email.Subject = subject; 8 {6 o+ [ G f
email.Body = body; 2 ?0 L5 y6 N1 K6 P) Y+ t. o
CCO.Email.setup_smtpmail_server_and_send(email); + L: w# H' j5 }- a- `+ J
2 `5 S7 g2 s& M" Z _( p. x2 w
// Alternatively use the SendEmailToIdentity
; N$ F: r0 Y" ?% _. f) ^- E// The first argument is the Identity name to send the email message. % c7 o1 r& p) ^: G& V- Y
// The second argument is the subject text.
# I; o, k# |, O {/ f D. p+ O// The third argument is the email body text.
2 o0 \! w( e' @5 w b( Z- R: Q# @// The last argument is a user login name as the sender and # l" M" S) O6 G y, p4 D& y7 E
// if blank will use the logged in user name and 2 F4 ]. [& W# u1 y; S: _
// that User Item must have an email address as well. 0 @8 P# Z( s+ T6 l
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
. {* E* J6 d7 J3 Lreturn this.newInnovator().newResult("ok"); & {1 o# `+ f) {% X1 _
VB.Net
! b( L* B* i1 lDim email = New System.Web.Mail.MailMessage() , ^$ l' R- l8 w5 h
email.From = fromEmail
1 d8 K% \9 ~0 Z$ A' h% q: U( pemail.To = toEmail $ D+ X5 D3 Q/ m) i2 A0 D
email.Subject = subject * I" c4 ^: e+ y. m8 U
email.Body = body
% C7 C |+ K9 ^ C( u3 B' H+ {8 u, vCCO.Email.setup_smtpmail_server_and_send(email)
" f; P9 I: m3 h9 v5 B+ u
$ W- B6 \% B6 m* G+ Y# G% a. h1 u' Alternatively use the SendEmailToIdentity & y8 X$ O% Y, A0 `8 Y" T
' The first argument Is the Identity name To send the email message.
9 |+ P( }, S- m* _4 Z' The second argument Is the subject text. 4 M4 Z$ J2 J1 X+ ^
' The third argument Is the email body text. / o# A! f# }* b
' The last argument Is a user login name As the sender And
2 _$ s% G* J% p9 w& z' If blank will use the logged In user name And
5 u: j) p W1 [0 h' that User Item must have an email address As well. 8 p. A" W8 _& f* X" _# s' Z
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
. u8 K4 ]- [( h) D( ]6 p5 g
Y2 @" a4 N( j2 E |
|