|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 2 a- H6 d8 c) r" ], a/ V
Use the CCO.Email object to send email messages. ; V. F9 |6 o( V
C#
" b% X1 c) {) z% y$ ~& ^+ Y: u- v& `System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 0 G- k: k" U, Z0 x, H/ |4 s+ K
email.From = fromEmail; ' E. P: g0 I! t6 K5 k- \' l! l
email.To = toEmail;
. A0 k5 M. Y$ S1 L$ m' X' R; Vemail.Subject = subject;
. I# c" z1 B+ W- ]% Cemail.Body = body; & k8 d% ?# L# e
CCO.Email.setup_smtpmail_server_and_send(email); 1 Y* z C& `% f7 s" e3 m- ^; J' h
; H7 |1 M! @' N6 q* w/ v// Alternatively use the SendEmailToIdentity
, l6 P% c# l9 f! f9 n// The first argument is the Identity name to send the email message.
; U7 b+ B- b% R1 U1 B5 D& O% Z2 G! J// The second argument is the subject text.
4 ~0 \! r$ g/ t, b4 j/ Z. a8 K// The third argument is the email body text. ' Z3 G, d6 T+ U' Z: z) r
// The last argument is a user login name as the sender and . q2 c' i9 n9 d6 A* n& T. x
// if blank will use the logged in user name and 8 z9 |1 E! O3 O6 C2 M
// that User Item must have an email address as well.
, ?% q& ]4 k" k* K: t5 jCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
' L% t- ^4 Z' @8 ^( |5 qreturn this.newInnovator().newResult("ok"); ; V# o+ C. n( f3 Z, T1 _* f( m
VB.Net * W, g/ i/ k" e5 z( ~
Dim email = New System.Web.Mail.MailMessage() % | B# @6 Z6 {" b4 P1 l
email.From = fromEmail * {6 |$ `0 J5 W9 {5 z
email.To = toEmail . u) h1 ^* l7 g9 l- x3 w" p7 e
email.Subject = subject * u3 F* R+ M0 l7 {7 _" v
email.Body = body
% x: U7 q" W% R& OCCO.Email.setup_smtpmail_server_and_send(email)
) r# k" \: V+ T1 d9 t8 O7 P; H
+ I' V5 Z* V& |; T1 ^# P' Alternatively use the SendEmailToIdentity
% Y k ?9 I* U7 P9 `' The first argument Is the Identity name To send the email message. " ^" [0 }2 ^' H9 b
' The second argument Is the subject text.
3 I9 b# T# y' n: ^! W6 |3 Q4 _' The third argument Is the email body text. 8 V; V! y8 A8 h% k% |
' The last argument Is a user login name As the sender And
& k3 i3 n6 M U1 \. C" r$ Z' If blank will use the logged In user name And
2 a. Y' Z2 k5 b3 w0 b' that User Item must have an email address As well.
9 v3 N% ?; C+ ~, r/ oCCO.Email.SendEmailToIdentity(identity,subject,body,user)
( \0 K% z, D8 _/ L2 O& c# D2 E' g# k, b) {7 r* M) F) A
|
|