|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
& h' H8 g0 f' T( l, V2 o5 PUse the CCO.Email object to send email messages. # M5 s& E( X/ {: J
C# g3 S* o3 s* v; J7 C0 f
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
+ T& O: b# A; `% _# {9 q. Semail.From = fromEmail;
9 S% `2 P4 R `: m( Femail.To = toEmail;
7 F6 n( {) K' \email.Subject = subject; 2 x) i2 {! ?! K" @
email.Body = body;
4 F5 V" o9 ^" T* iCCO.Email.setup_smtpmail_server_and_send(email); $ {! M1 J- ?% q1 j% P H
. l% V M L$ K. \( A3 D& I4 [// Alternatively use the SendEmailToIdentity - n$ e! b0 U0 l+ f9 f$ G
// The first argument is the Identity name to send the email message. & g8 U3 ?9 V! @ u j9 @
// The second argument is the subject text.
, Q) h: b5 p2 R8 M) V4 M9 \5 g// The third argument is the email body text. ( f+ v$ y/ P: n G2 m
// The last argument is a user login name as the sender and
m" F/ A7 g, P$ J// if blank will use the logged in user name and 5 u+ ~# `( j2 a: g1 {$ F
// that User Item must have an email address as well. : _; K8 l2 N$ w) v+ s1 K s8 u
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 5 ?3 V3 I J1 J* f `) G& c0 l
return this.newInnovator().newResult("ok"); ; A% u6 R+ K7 O5 [0 J. s' k7 K
VB.Net 6 z9 s' h: M6 u" P# ^" ?' A1 d
Dim email = New System.Web.Mail.MailMessage()
) K$ p" P6 W1 P! q& eemail.From = fromEmail 4 }8 ~; R" q% T! I" t
email.To = toEmail
4 l4 f$ N$ m1 `4 [" q- Jemail.Subject = subject
& l: z6 y! p& _3 |4 h( g- ^email.Body = body - K7 ^. v. A9 r1 P1 S+ G9 b+ S' S' Q- k
CCO.Email.setup_smtpmail_server_and_send(email) $ b B+ |) P; z. c5 {
' a t! M& s/ Z! q' Alternatively use the SendEmailToIdentity
1 b! Q9 U o+ i; m: _' The first argument Is the Identity name To send the email message. ) @+ G: |6 m' f% J% \$ N& x& x4 T
' The second argument Is the subject text.
6 D( W5 T" j" \* P2 k' The third argument Is the email body text. 7 c, U! m) p2 [
' The last argument Is a user login name As the sender And
6 b5 o! s: T1 X: v' If blank will use the logged In user name And
Z# ]" \$ c0 R( t) {, l' that User Item must have an email address As well. 4 e* P2 e3 d7 g! z% R
CCO.Email.SendEmailToIdentity(identity,subject,body,user) ' o- _3 K+ v1 H8 [$ s& ~
$ y5 x: ~) n( I9 ?( Z0 \ |
|