|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
! N2 O8 i: w" n4 sUse the CCO.Email object to send email messages. ; l @3 K9 |( f6 n. y/ B: x
C# : t6 R! ~. o3 w7 p
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); / K, B( v' N8 y, s
email.From = fromEmail;
' K+ C+ G5 q( X6 q" J2 M9 Eemail.To = toEmail; . d" G i2 A6 W& H. W$ X
email.Subject = subject; 5 z: V/ x/ q$ w. w' r
email.Body = body;
0 u0 D' n& C2 Q8 tCCO.Email.setup_smtpmail_server_and_send(email);
G; l/ S2 c9 s% p4 R $ n) l0 P; _4 ?
// Alternatively use the SendEmailToIdentity
/ [' q f% F! n, `* x4 v0 s// The first argument is the Identity name to send the email message. 7 L/ {& x! N7 N: l5 z: [8 P
// The second argument is the subject text. + r3 Y, x" a* ~3 K
// The third argument is the email body text. ) t Y; \$ a( t Z* q4 _' h" D
// The last argument is a user login name as the sender and . Q: C9 z' G4 v
// if blank will use the logged in user name and
]) z$ ?0 F: C2 b// that User Item must have an email address as well. * f$ W, H* ?* v
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
. ]) K! V* O7 W7 f0 B% _ I% jreturn this.newInnovator().newResult("ok"); 7 M w0 I# ^) v% }# L" a
VB.Net 6 V6 {' ` R% ?: K
Dim email = New System.Web.Mail.MailMessage() 0 o: }& x8 j& r6 Q- x: L1 c
email.From = fromEmail 9 S& r1 n/ \$ `" n
email.To = toEmail $ ^: l3 Y" p1 e# L4 S" k/ O6 A; I
email.Subject = subject
+ L* ^6 G3 d( Wemail.Body = body
) t$ @' Z, K& F3 T( gCCO.Email.setup_smtpmail_server_and_send(email) + y9 W& W! N, A7 p& ]5 f' Y
: @. P( |; s K4 |- F5 `$ v* N
' Alternatively use the SendEmailToIdentity % D% a4 K# \) c" N$ K
' The first argument Is the Identity name To send the email message. 8 m/ w% v. H& o) J7 s
' The second argument Is the subject text.
0 N6 j% {; Y- j9 r- a+ ]/ H' The third argument Is the email body text.
9 f L8 z( P% q0 r) Q# F$ t' The last argument Is a user login name As the sender And 6 M; D! k" X# S2 f" ^
' If blank will use the logged In user name And & t+ x5 M- ?2 A1 ~8 J* w
' that User Item must have an email address As well.
0 ^1 c" r* ^0 F; y& uCCO.Email.SendEmailToIdentity(identity,subject,body,user) 1 d4 Z/ w/ v' B! e6 A
% g; @, g2 J$ c |
|