|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
' e9 `1 {$ i* b) t/ `8 jUse the CCO.Email object to send email messages. : ~- Z) ~# z9 [9 J
C#
u% c/ C5 G% R; i; w WSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& r3 m/ S/ W; E7 B. Yemail.From = fromEmail;
% {# n# h n( Y1 vemail.To = toEmail;
, H" w* [2 G! V) ` ^; Q+ remail.Subject = subject;
; s* C+ Z4 q9 o: M2 r5 gemail.Body = body;
" G% x' d* q6 r# Z1 g$ H, ?CCO.Email.setup_smtpmail_server_and_send(email);
: m& k% a8 `4 r0 R. q: P" u3 H N6 z8 q j0 Y# C; `
// Alternatively use the SendEmailToIdentity 6 S; a3 x; h. U& J
// The first argument is the Identity name to send the email message.
+ i" p6 p* f6 M3 l0 D// The second argument is the subject text. & o8 B# M3 H2 v6 v* ~
// The third argument is the email body text. : ]: Y8 q0 @, T3 x x3 |7 Y" T
// The last argument is a user login name as the sender and - b7 D2 _! f& r1 n7 @
// if blank will use the logged in user name and
$ r0 K3 I0 b: w8 e6 R: A* \5 }// that User Item must have an email address as well. 8 B9 H+ F2 y6 C3 g- _
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
* D+ k. h. v6 I0 `, Breturn this.newInnovator().newResult("ok"); ; _( P7 j9 l: s9 ?. r5 Y: l) U# G: a
VB.Net H9 F, t, s4 T. U
Dim email = New System.Web.Mail.MailMessage() $ E. p' k) V1 |
email.From = fromEmail
5 e: i' }/ B W6 J$ E9 O1 Oemail.To = toEmail
& P8 v; n3 T; O4 U; s9 _3 N# H2 i9 memail.Subject = subject
7 y0 Y% e' G0 n, C, w: _email.Body = body 3 q0 g% e. N6 p/ K
CCO.Email.setup_smtpmail_server_and_send(email) 7 @* e9 `1 A o- _3 x, v
6 Z7 R3 m% _/ F9 E' S- X1 h' Alternatively use the SendEmailToIdentity
& Z5 X. F( N' S% K+ N* b, d' The first argument Is the Identity name To send the email message.
0 ^$ ?* @5 S( m% ~$ x& |: L' The second argument Is the subject text.
9 ]3 z# V% M: x3 ^: }( u' The third argument Is the email body text.
( c3 |3 M3 Y; z7 j$ }1 @, A' The last argument Is a user login name As the sender And % Y( K% }% c/ `4 e
' If blank will use the logged In user name And
" y: ?. B" F" o# {( G. i0 C) }1 Y# b' that User Item must have an email address As well. ; A( t+ R3 c# d) @# X! q
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
: X! n' h4 a- {2 R+ K# O" i7 n: L% L. p/ f. _4 j5 z
|
|