|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 3 T, Z, J' o8 F/ n1 E
Use the CCO.Email object to send email messages.
0 @, l& ]6 k1 K7 c! Y! p9 xC#
2 [; W# z. e3 [7 _% W, s' `7 sSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); * R5 ^& G+ G4 l! A% B
email.From = fromEmail;
' E {0 V. P- c$ w0 G/ cemail.To = toEmail; 1 z0 w! z6 ]' c
email.Subject = subject;
3 a2 X' f6 ~" @) B! ^email.Body = body; / n5 u6 b* V0 o" l2 ]" R( g, }
CCO.Email.setup_smtpmail_server_and_send(email);
) R) v8 h" k1 @0 J4 d$ ~0 _
4 r3 l3 ^! @2 V) o$ m// Alternatively use the SendEmailToIdentity
0 Q* d& f* d$ K; V u5 c// The first argument is the Identity name to send the email message.
* `8 G$ ^! q& Y2 C% D// The second argument is the subject text. ; {- _& q- [0 r: q" x5 L
// The third argument is the email body text.
8 j& t8 g* ^) b9 b8 c i// The last argument is a user login name as the sender and
# _: m% ~. C/ w4 [// if blank will use the logged in user name and 0 Y) ~* g1 |- e" z/ | _& z
// that User Item must have an email address as well. " Y& h# A; G+ \! g% l* ]
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ' ]/ i# \! x/ ^
return this.newInnovator().newResult("ok"); 5 n( i/ V+ ~5 X4 |" Y% E
VB.Net 5 p' j# x: I+ V6 f
Dim email = New System.Web.Mail.MailMessage() 8 Y' |8 c2 e; _7 X r
email.From = fromEmail 5 z8 c$ X$ j8 }, g4 a( B
email.To = toEmail
5 h3 p; s0 A1 T3 i* P0 L4 f! Memail.Subject = subject
" L* t) F5 S/ _; Q4 remail.Body = body # V& {. [. Q3 z% V
CCO.Email.setup_smtpmail_server_and_send(email) / ~& \9 J. `$ a, M4 {* r: a
0 V, j/ s7 G$ ~/ l
' Alternatively use the SendEmailToIdentity ) w0 S6 k$ B" k, N7 \& Z
' The first argument Is the Identity name To send the email message.
# I1 X( O2 w) _. G6 t4 @' The second argument Is the subject text. 7 ]3 v2 R0 I, ^4 R; M/ `6 j$ r
' The third argument Is the email body text. ' ], s* z3 c$ ]0 H% w
' The last argument Is a user login name As the sender And : ?" M6 b1 W& ]& ^ y* \
' If blank will use the logged In user name And / s3 ~# v6 z+ Z9 i
' that User Item must have an email address As well. - r/ a9 S% N. h' L1 T/ a+ g
CCO.Email.SendEmailToIdentity(identity,subject,body,user) + X9 j% ]6 p7 Z# h5 B
0 F- Q, B, z% G5 O( M1 w+ s! g1 c |
|