|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 6 {7 f1 G5 K- Q4 |
Use the CCO.Email object to send email messages. # u5 |& \$ U" x' P
C#
' H& u* p: t7 x5 X3 NSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); $ {- v$ ^/ b1 k$ g6 h7 n4 q3 T# A
email.From = fromEmail; ! r. E5 d7 _" @; D' k
email.To = toEmail; * l6 n6 c' X( X6 Q* `% |
email.Subject = subject; & |; ~$ C/ Q( M! e# H7 G! h# ?1 T
email.Body = body; % }" t" p- D: F; p
CCO.Email.setup_smtpmail_server_and_send(email);
+ n0 \7 P' x, q( V0 ]* @; c , w9 v1 O2 q2 K T+ C
// Alternatively use the SendEmailToIdentity
5 Z; E/ A" R' K// The first argument is the Identity name to send the email message.
" [% Y! `4 @$ s2 P6 p// The second argument is the subject text. $ M! _: M0 |- y
// The third argument is the email body text. 0 \5 o8 h7 h3 F. j) X% G
// The last argument is a user login name as the sender and
& p3 I0 j- @$ C) x1 ^: p! p// if blank will use the logged in user name and
. i% q0 P3 X: W( K% v. [// that User Item must have an email address as well.
7 z! H# y \! M- x& Y0 {CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); & R7 m2 g" K' m( L. U: [6 K
return this.newInnovator().newResult("ok"); ! w. x6 Y! s/ F& d9 }0 N* L
VB.Net
" U3 i0 U9 ^+ kDim email = New System.Web.Mail.MailMessage() 8 |' |8 y* }% \% t% L, ^
email.From = fromEmail & ^. ?! F! k# p2 W$ ^
email.To = toEmail * F" I) h' ^4 b9 C& P
email.Subject = subject
/ c! c4 s: p A9 |5 h. n% w2 Q' [email.Body = body ; `& x1 B) r& ~; C P, @
CCO.Email.setup_smtpmail_server_and_send(email)
; X" a8 Q% L; m+ J0 k7 S6 d
% a v% y/ s9 L$ Q2 }! T' Alternatively use the SendEmailToIdentity
* T$ m. c. Y) C) z! f2 G' The first argument Is the Identity name To send the email message.
9 O/ k0 l, Y5 H' a$ Z' The second argument Is the subject text. 2 l" n) O2 Q2 {* Y# _' R$ j, Z* d6 w
' The third argument Is the email body text. " ?. F S0 D% `
' The last argument Is a user login name As the sender And # U1 C- N% P$ [2 d! h! ~
' If blank will use the logged In user name And
1 B/ r# t0 h G' that User Item must have an email address As well.
+ Q F; z! ^+ } v, z5 lCCO.Email.SendEmailToIdentity(identity,subject,body,user) - h4 k' X3 c7 ^0 a' k( f& a7 K8 N
6 `& J2 N& ?! @6 ~8 u0 R ^
|
|