|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 1 u, M7 A! ]/ J5 D
Use the CCO.Email object to send email messages.
g4 d: \- ]: Q) H* ^$ P& PC# / Z- _+ u6 k {6 [
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 8 a6 l$ g2 w% J& W, | ]6 A- L/ {* R7 ^
email.From = fromEmail;
: F4 v' c9 v: _) R |email.To = toEmail; 1 i. @& x, n0 n4 \% \1 K
email.Subject = subject; 0 O% b9 ?7 x" q& A# A6 |6 C# \
email.Body = body; * g7 ], @( d+ v! F. G' M+ p
CCO.Email.setup_smtpmail_server_and_send(email);
+ Y& f' r( y: D; V% }, I4 l4 ~5 D
0 { {- O4 C& x7 w2 r y- a// Alternatively use the SendEmailToIdentity
+ v& C9 A# W9 L" W" C// The first argument is the Identity name to send the email message. / v, v- Y" U4 F( n# F" }2 Z
// The second argument is the subject text.
/ ?8 {- h4 I3 D9 ^) I, e0 ~1 x// The third argument is the email body text.
" C' ^. ~* M; u// The last argument is a user login name as the sender and
$ H4 {4 |$ n' H6 \1 G// if blank will use the logged in user name and $ \( I/ z+ j+ p6 E3 v3 @
// that User Item must have an email address as well.
7 w# B: y. B2 _7 F6 D3 \- y+ hCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 5 y% X6 M: L# U/ w1 o6 ?: Z
return this.newInnovator().newResult("ok");
# g6 l" O7 M. S& r/ r1 M* [ VB.Net
8 r3 x" d/ B V; z4 ZDim email = New System.Web.Mail.MailMessage()
5 J) `) w7 m: @ f6 [, F4 i4 zemail.From = fromEmail
) b4 i& _) n2 Iemail.To = toEmail
( c1 |3 Y- A8 c, \1 i! |1 Femail.Subject = subject
6 N; Q, s) T; Vemail.Body = body
/ h( ^8 E8 G% @0 NCCO.Email.setup_smtpmail_server_and_send(email) 4 Y1 K0 g K1 f2 O
/ ?- L( q7 p: J P9 C' Alternatively use the SendEmailToIdentity
U* H2 V4 }' r" |4 _. ^' The first argument Is the Identity name To send the email message.
1 v* q6 p7 y" s: o7 N' The second argument Is the subject text.
+ B' ~" F3 b5 y0 s' The third argument Is the email body text. / ^5 `. p( \: N! |( l3 c. w7 k
' The last argument Is a user login name As the sender And
+ N3 R5 u% w- B" ^' If blank will use the logged In user name And 3 e2 O2 n1 Y8 s# W, B
' that User Item must have an email address As well. ; N+ a& y/ ~$ O3 n! u- X e
CCO.Email.SendEmailToIdentity(identity,subject,body,user) % `: }( O& w4 w$ ^
% V! ^* f# \/ V/ o2 Y |
|