|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
# F& f' z" J5 t* v0 F: `/ uUse the CCO.Email object to send email messages.
% {1 Q) @3 B* eC#
- ]4 W+ A8 h- q) X' ^System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
% M6 T; ?6 ?8 p3 u8 xemail.From = fromEmail; ) I7 a. ^, i7 ~' Y5 }$ M- }
email.To = toEmail;
& n+ B! d# {3 Y; @7 b/ kemail.Subject = subject; % b# _4 H8 r" V, v3 J
email.Body = body;
3 B: q% g# X6 Y+ W8 \, _CCO.Email.setup_smtpmail_server_and_send(email);
( f1 o @* P( U3 _ 3 b8 K6 C2 R# l5 c
// Alternatively use the SendEmailToIdentity
( B6 C" a+ o1 l' _- k! Q0 w// The first argument is the Identity name to send the email message. ) _4 M& B8 ]7 h1 a( W
// The second argument is the subject text. h, ~1 ^# |6 b& Q- P2 v0 F
// The third argument is the email body text. * M. |8 d/ b: Z" a6 `0 y: _
// The last argument is a user login name as the sender and . P V, N2 h- }7 }4 u- d$ u
// if blank will use the logged in user name and
. h q! M3 g3 \3 k3 w$ K" g# n9 R! ]// that User Item must have an email address as well.
7 O. B* z. n0 O8 [' E, \* v3 U* OCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
6 q, `! d" f/ [. P0 \- z# M E$ B4 dreturn this.newInnovator().newResult("ok"); . k; e- P% S0 I$ J
VB.Net 1 R$ Q& {1 A+ Q' w
Dim email = New System.Web.Mail.MailMessage() w/ o, m# t% `- I. n, l
email.From = fromEmail
' c# s* C5 M1 F6 o" Jemail.To = toEmail Q8 q# [! X% E$ Z# }
email.Subject = subject ) i* _; \+ |& D5 u% F* v
email.Body = body 6 o- D( B& `) u* Q1 z
CCO.Email.setup_smtpmail_server_and_send(email) # Z- H4 v9 @. U5 C4 \% v
" e* z, w4 C$ G y' Alternatively use the SendEmailToIdentity
* ?9 E- y: D+ [8 O b' The first argument Is the Identity name To send the email message. : ?, `' q$ [& u3 t
' The second argument Is the subject text.
" K( k$ O# E* Y) e8 ?$ R& u( U' The third argument Is the email body text.
2 Q( N, b& M+ w8 B) [1 \6 k' The last argument Is a user login name As the sender And
3 P7 Q `8 @1 i) u( t; }3 e- d' If blank will use the logged In user name And
; R6 M! p. W, A; h- u4 o7 j2 E' that User Item must have an email address As well. # d) P# }* i: F9 [ C; q
CCO.Email.SendEmailToIdentity(identity,subject,body,user) 4 z: f* ?' \/ `- {% y7 Z8 u3 ~. o
$ a& A8 [# o$ \! T/ }; W, T |
|