|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
9 C5 K& Z& U& F9 ^& B4 y$ rUse the CCO.Email object to send email messages.
* C1 x2 i* H9 ?# LC# 2 U9 ^/ {# R+ }* t" @+ T8 z
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 6 v; P& k+ J7 X
email.From = fromEmail; / I7 v( V) k& _5 p7 Z
email.To = toEmail; - r0 @9 e: M. ? D* O" m. f
email.Subject = subject; ) m3 t1 q2 L( G: S
email.Body = body;
# e0 y2 }1 ?. e: O8 o! U nCCO.Email.setup_smtpmail_server_and_send(email);
9 @# o$ e2 @8 o$ V9 q * W u" j6 t. I6 c: i
// Alternatively use the SendEmailToIdentity
- T9 I: S% r8 d$ `" E, [, f8 y// The first argument is the Identity name to send the email message. $ }$ h9 v$ b2 X' l" w8 i1 P8 I3 ]
// The second argument is the subject text. 9 Z$ G6 `0 i' \, j4 p0 F
// The third argument is the email body text. 4 L d0 H- b( R3 h
// The last argument is a user login name as the sender and ) @( R% F/ {& i5 |
// if blank will use the logged in user name and 8 g" |$ E. w; ^: R+ k
// that User Item must have an email address as well.
8 }1 h, ?- p5 Y4 ?. UCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 8 V/ g( f E1 R. y& Q8 S
return this.newInnovator().newResult("ok"); ) [) J- {+ e; E n& D
VB.Net ( R" q B) x. s/ Z8 r" k( }( V4 |
Dim email = New System.Web.Mail.MailMessage()
# v2 y- u: t$ h- p2 A1 Kemail.From = fromEmail
( M+ s( B9 x' g6 ? |$ J& X6 Pemail.To = toEmail
* @% B' o) l c" kemail.Subject = subject
- P0 y6 D4 \. f0 g/ d0 nemail.Body = body
6 K2 p+ {: @7 A# b7 VCCO.Email.setup_smtpmail_server_and_send(email)
9 [5 `1 U6 a( D4 o& g
( ?4 O' n. N# T* C' Alternatively use the SendEmailToIdentity
% A, O3 j0 C B3 o' The first argument Is the Identity name To send the email message.
* T' X0 i w$ H0 ]- C7 _$ y3 ?: p' The second argument Is the subject text.
. r1 h; m. ~3 B' The third argument Is the email body text. 3 M$ J) w2 Y f
' The last argument Is a user login name As the sender And + p/ F/ ~2 `! s* _1 S1 [& P
' If blank will use the logged In user name And 4 ?3 ]1 D$ y0 d. g2 @2 J
' that User Item must have an email address As well. , i/ J$ b* K6 X: j# \- [6 j: d
CCO.Email.SendEmailToIdentity(identity,subject,body,user) ( q5 Z% K# `* w5 e/ t5 G
! I' n- Y' N0 D9 O
|
|