|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
( _# @/ _/ p8 b' ?: A; ~Use the CCO.Email object to send email messages. ( x. q; H; U% d! M% [
C# 0 n L" c; C+ J4 N6 C
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
' K' v4 p' g/ \; {2 s: G& jemail.From = fromEmail;
/ i! o2 [3 `. M6 N" e5 |5 pemail.To = toEmail; 4 W8 K' F( r1 ^1 f% Z! C
email.Subject = subject; 9 ?8 z+ u% y1 z9 m/ R5 P C; X
email.Body = body; # [( O0 U2 `- Q; t+ Q- |
CCO.Email.setup_smtpmail_server_and_send(email);
$ X v0 h( @- c1 t+ A# M
8 f% i9 X; h) L9 @// Alternatively use the SendEmailToIdentity 3 u1 ], c2 ^ _1 }1 G$ P: A
// The first argument is the Identity name to send the email message.
: T' _% [1 ?2 `3 H2 b- `. V& ]% V// The second argument is the subject text.
+ R7 S- V5 o% M3 T( y3 U: ^// The third argument is the email body text.
0 f. Q2 s( d% P! g' R, d// The last argument is a user login name as the sender and 7 e" L5 s- X& X* ~& X2 M
// if blank will use the logged in user name and ( ?7 p4 a" n3 c$ ^& R: N
// that User Item must have an email address as well. ! Q9 z8 ]9 s. n6 f' r5 D) P
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
% t0 e0 U! i& zreturn this.newInnovator().newResult("ok"); ! H! q5 ^5 ? X
VB.Net
5 C0 \ Z2 U/ T, i# V% D8 A+ vDim email = New System.Web.Mail.MailMessage()
9 n8 y) u" u F+ `& C8 `; \email.From = fromEmail % p+ I& Y' G7 u( ]9 l' g
email.To = toEmail
5 y$ a: V r8 w5 o6 F& E8 Z$ Q1 Semail.Subject = subject
1 n7 \6 X7 t, [* t% Y# Memail.Body = body + K) \. \4 A. r8 K, i
CCO.Email.setup_smtpmail_server_and_send(email) / K n$ g# O8 e$ G& b) p
2 [ B% K; O' {8 t7 ^9 R( p( Z" H; P' Alternatively use the SendEmailToIdentity
( P9 k' p' x& P. P% a# z3 Y' The first argument Is the Identity name To send the email message.
) f, n$ Q$ L$ W, `( c: `7 w' The second argument Is the subject text. . M2 J7 n: O* g/ I1 R1 k
' The third argument Is the email body text.
% q; D/ D# s5 T* ?$ _, q+ A' The last argument Is a user login name As the sender And
8 E0 {3 t, d/ T- ^' If blank will use the logged In user name And
( F) I. S: r& h4 |& W0 n) c; c& Z' that User Item must have an email address As well.
8 b8 ^+ ?; ?# } |9 vCCO.Email.SendEmailToIdentity(identity,subject,body,user) ; h2 k1 c Q4 b1 Y$ C: `
0 w- O7 i7 H* a8 u% ~1 U
|
|