|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
0 w; G7 N0 _: V# {: _0 WUse the CCO.Email object to send email messages.
4 Y: s3 u' N3 C: LC# # L# e, L7 `* A7 }
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
8 l7 Q, D. m; K8 E- I. R Y+ Q: ~email.From = fromEmail;
7 v" I5 a% g( oemail.To = toEmail; * J5 I/ r4 w. f8 }' M; G
email.Subject = subject;
$ J8 ^# a% u7 o1 M$ z) N' bemail.Body = body;
; v, C7 c3 r8 E3 g4 D9 a, tCCO.Email.setup_smtpmail_server_and_send(email);
5 }5 `7 e( C: k& k
4 l& C# c/ {. z# M// Alternatively use the SendEmailToIdentity 4 ?; ]. `: r8 q! J0 A9 |$ B
// The first argument is the Identity name to send the email message. , x7 \( Y# H# ?5 b; n& f) {6 |& c$ y
// The second argument is the subject text. : k9 @9 f2 @! ^) _: P, I
// The third argument is the email body text. , ^: L m* Z, @4 c, o
// The last argument is a user login name as the sender and
1 n i# `) v; Y' p// if blank will use the logged in user name and
4 e) ]- ]: ^+ e, K# |// that User Item must have an email address as well.
$ | f( O, p6 U# ZCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
- p* ]% ~* q; ?return this.newInnovator().newResult("ok"); ( E8 z+ O# S4 d6 `4 |* P
VB.Net
7 Q0 C5 a: C0 @. b$ n) qDim email = New System.Web.Mail.MailMessage()
" H: R1 a2 m# d O. N, ?% n* Vemail.From = fromEmail
6 w% H# K E# M8 f; ~email.To = toEmail ; B' G: P7 Q" O
email.Subject = subject / ^: b5 Y9 w+ R: L. b: i
email.Body = body
8 _$ s9 y5 _0 q! R& u/ U, iCCO.Email.setup_smtpmail_server_and_send(email)
+ o8 s- H% s; |6 }% P 9 C5 J" I- ]. Z8 O4 Q t3 K. ]
' Alternatively use the SendEmailToIdentity
, w9 u u% h( f3 r1 ~, s' X2 ]' The first argument Is the Identity name To send the email message.
+ g! P6 i$ m' L1 f' The second argument Is the subject text. - _, H- I5 J' y! b5 C R7 l
' The third argument Is the email body text.
5 I' p: B+ m8 A6 i' The last argument Is a user login name As the sender And ; ~& |: k- J; F. C) n) b
' If blank will use the logged In user name And
3 d: j' [2 q& o- c, y9 m6 g& S0 o- A1 Y' that User Item must have an email address As well.
& D9 x# M$ C5 O5 hCCO.Email.SendEmailToIdentity(identity,subject,body,user) 0 w1 t+ v; s; V
% J. z5 A, z" p* k. A% k7 N+ Z4 X8 w |
|