|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 1 I6 d ?1 \! q- y! Q2 R
Use the CCO.Email object to send email messages.
/ r3 b, `' E) e/ T+ TC# % b+ p. L9 r6 t1 Q) B
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); , |5 I' i- X$ f) d0 {
email.From = fromEmail;
- q4 N: j c# l2 t/ ?6 @email.To = toEmail; ; v1 Z, _) S/ a0 ^- b) W
email.Subject = subject; " {9 ]+ n' {) b2 U$ ~, ~
email.Body = body; 6 a3 Y6 p+ \, g/ V _' X' d
CCO.Email.setup_smtpmail_server_and_send(email);
$ {, q( b' p6 K6 h9 ]! P) {3 Z 4 K1 p7 C1 C. N! \4 _
// Alternatively use the SendEmailToIdentity
$ A# @* V8 I4 Y6 X4 X$ k// The first argument is the Identity name to send the email message.
* n5 b# U% u+ f; R. H+ _// The second argument is the subject text. 1 S8 [1 N; J! y: h; C, z6 h
// The third argument is the email body text.
! O9 o# ]5 Z; D% K// The last argument is a user login name as the sender and
% k5 S# Z2 e9 k! W// if blank will use the logged in user name and / L% P5 i9 i+ J" }: z+ a
// that User Item must have an email address as well.
: M; B- \3 E, e1 O$ lCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); * }; v' V" q( I2 C3 ~
return this.newInnovator().newResult("ok");
) s$ f0 o: f% t& I; Y2 j; C7 m VB.Net 8 ?# j7 c- Z& f Y
Dim email = New System.Web.Mail.MailMessage()
( @1 [/ i& o0 ^/ @' ~% f$ uemail.From = fromEmail
; v% s+ S/ f7 [# \# @1 D1 @email.To = toEmail
; c8 L- J2 N, E; R4 H _+ lemail.Subject = subject
4 z* ?3 ?! H/ n/ p! Uemail.Body = body & R) f5 Q9 |) Y, m! S
CCO.Email.setup_smtpmail_server_and_send(email)
/ u3 s y# P# [ $ m1 A; S# X( G+ c8 H2 O
' Alternatively use the SendEmailToIdentity
2 v m2 f b3 ~6 O3 d5 Y; j' The first argument Is the Identity name To send the email message. y! O) _% U3 v/ V8 ]. K5 M$ f
' The second argument Is the subject text.
9 O3 F" S# O" G& m. }8 X" p0 n' The third argument Is the email body text. & L! E0 Y: ?. W) _8 v: H
' The last argument Is a user login name As the sender And
( z9 e( U) E. e( ?' If blank will use the logged In user name And L8 O" ]9 W8 V- K* O6 o- x j
' that User Item must have an email address As well. " }5 `7 J2 i7 g5 F/ [ @
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
4 C$ s6 s- R* u
* |7 I* I0 h# B/ f+ L3 j5 _ |
|