|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
0 y$ y: \4 Q/ `( [, }" @Use the CCO.Email object to send email messages. 2 f6 r0 B' [$ e8 n9 l
C#
% Q w; \, g/ tSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& @7 Y. g% E; d b, {+ Semail.From = fromEmail; 7 u, g0 ^; {1 j
email.To = toEmail; , I2 g) {* g, L( V
email.Subject = subject;
% _- a! d9 d l8 Kemail.Body = body;
$ ~$ s6 ~2 Y8 Q& m8 U; s3 W' kCCO.Email.setup_smtpmail_server_and_send(email);
' ^7 x: s, l0 _4 u( C' ?# y, S ' q3 y1 S8 A1 q& [$ w- o T! r
// Alternatively use the SendEmailToIdentity
* R4 Q7 @& Q4 {3 @// The first argument is the Identity name to send the email message. 9 W: e, M/ I. l" q1 i9 F
// The second argument is the subject text. ( D$ b$ T6 U2 Y' ~* s/ k. H
// The third argument is the email body text.
9 m d5 m3 n: K* q3 D// The last argument is a user login name as the sender and
, w; r, V1 t: Z// if blank will use the logged in user name and 2 _0 W/ O) c5 G% g5 O
// that User Item must have an email address as well. . M! n# d/ e; p, L1 @
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); . B8 Z. c# c+ ^9 U- O; Y% j$ N% e& I
return this.newInnovator().newResult("ok");
0 Z7 h" I$ C _" x! w) {# U VB.Net ' b" L' z2 R3 r
Dim email = New System.Web.Mail.MailMessage() 4 ^6 k( A- i, Y: I: C$ a0 m% ]# f3 L" J
email.From = fromEmail
+ @2 [+ ^/ e3 G; Gemail.To = toEmail 9 N' N2 U6 R2 {$ k; `, O; _
email.Subject = subject 4 F" U4 P, j! g) X! _
email.Body = body 8 C. p q9 g" k$ r: |
CCO.Email.setup_smtpmail_server_and_send(email)
6 L; q. ]7 D4 r. O
! ?8 N, P. l+ N6 z, e' Alternatively use the SendEmailToIdentity
. z# G @3 P" M$ T3 o+ _, Q* a' The first argument Is the Identity name To send the email message. & q3 E) q( |; a
' The second argument Is the subject text. $ S) n) c, a& l5 R; l( |7 Q
' The third argument Is the email body text.
2 p" v) j) b1 G. f' The last argument Is a user login name As the sender And
/ G3 U! Y7 F" a+ Y; \- Q( e) b( U3 I' If blank will use the logged In user name And
% a3 R/ o, l8 ^' that User Item must have an email address As well. * W! [, @5 e' Z- x; S; R% X3 g
CCO.Email.SendEmailToIdentity(identity,subject,body,user) " B a$ E! x: T: D2 A8 n7 {* m
1 v b* r3 H9 Z+ j O
|
|