|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 6 J' a% V/ K9 t5 `: q
Use the CCO.Email object to send email messages. - ]6 R3 O$ b1 m+ p
C#
3 P9 f' m( W8 I7 ~9 D6 hSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
, v! d. ~( X g7 X4 j- Uemail.From = fromEmail;
; n! Y: s ?7 ?" l; `# p$ \email.To = toEmail;
+ C# I8 D4 d8 t+ l9 u' v- Z+ hemail.Subject = subject;
3 M; g4 K/ @0 w9 _* ]email.Body = body;
# h, Y6 e2 o3 Z( CCCO.Email.setup_smtpmail_server_and_send(email); ! D3 W. k0 y7 ^3 h/ Y
9 g u4 U1 e6 m' b( M// Alternatively use the SendEmailToIdentity
/ e1 A( O0 P7 V, }. W+ g! X// The first argument is the Identity name to send the email message.
' {* l, x* `# d7 k& v$ ^// The second argument is the subject text.
% S% j+ ]& s4 u4 x) j' R: F// The third argument is the email body text.
6 W( p+ e/ I# b- f8 o// The last argument is a user login name as the sender and $ l$ | A$ {% p! f; ~
// if blank will use the logged in user name and + a$ a/ W) o9 w: o7 }
// that User Item must have an email address as well. 3 \, M3 x% i! {2 ]8 X' X0 V$ Y
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
/ C$ c- N) ~# @8 M( F! b$ `1 creturn this.newInnovator().newResult("ok"); ( b5 I3 b5 ~% E
VB.Net
1 o# ^( B J i& I/ @. m6 V" ]2 f% ?Dim email = New System.Web.Mail.MailMessage()
) J9 `# |' l, B* Bemail.From = fromEmail ' h( R; a7 _! Q& O9 s: I
email.To = toEmail
; o. D6 ~) G5 R/ {* P: a! jemail.Subject = subject . |; I) \/ Z8 b3 c% v$ ~+ h m& M1 ]
email.Body = body
$ ^ }/ o' x$ J0 C% BCCO.Email.setup_smtpmail_server_and_send(email) ! P" [, o5 V' {7 u; T% G
, R1 c1 Q7 a1 ~$ C9 [' Alternatively use the SendEmailToIdentity
; h- X; x$ Y: K' Q/ l8 i7 W' The first argument Is the Identity name To send the email message.
2 C; b; h: d' ^. r2 G$ G' The second argument Is the subject text.
{7 D) w& p d' The third argument Is the email body text. ( X& l/ n& I# D3 V2 Q. V7 t6 L5 M. Y) n
' The last argument Is a user login name As the sender And 1 ~. B: v, \# B( T# |( [6 K# P! [) }
' If blank will use the logged In user name And
7 {1 S' V. ?& l# K' that User Item must have an email address As well.
: R a9 \2 S, v- \$ v0 OCCO.Email.SendEmailToIdentity(identity,subject,body,user)
* g2 c; k2 L5 j% L- r3 |- {
0 A$ I D/ q' O8 q. y3 g, q4 B/ R; X |
|