|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
/ y% a3 u4 J. V3 Y% ?Use the CCO.Email object to send email messages. h. A/ Y! |: n% b& y/ C: _
C# % r* t+ h# h1 u- C" U- ^- l
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ' l$ B' P t$ u* D2 @7 X6 E5 |
email.From = fromEmail;
4 Z5 N w) J. E" z1 N2 I4 eemail.To = toEmail; 1 T* I' C/ J/ X
email.Subject = subject;
: A8 h% \9 p6 ^% L% xemail.Body = body; P3 l. k' f) W! J \: X
CCO.Email.setup_smtpmail_server_and_send(email);
5 B2 s& a) y3 F! w
2 }6 J# a- B/ ]8 f& X$ ]// Alternatively use the SendEmailToIdentity
9 n8 q, ]; ~' e; A: E1 l1 v// The first argument is the Identity name to send the email message.
* V1 y% l+ p6 b1 n0 {+ d// The second argument is the subject text.
' k1 ]' V0 [, q// The third argument is the email body text.
. w# N) V0 @5 W4 W% S" |// The last argument is a user login name as the sender and . O* }8 Q% I6 X; \, g7 r
// if blank will use the logged in user name and
* G' Q0 F! J: I# Q8 D. P// that User Item must have an email address as well.
, q( H3 y, C& @( T" f/ jCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ! i, Q3 F/ b# E% Q1 _- r
return this.newInnovator().newResult("ok");
8 u) t" e$ m8 Y! u9 C; L VB.Net
! ]6 z# w( J0 ?5 w9 a; F" WDim email = New System.Web.Mail.MailMessage()
& ^9 i! V$ F$ @4 Xemail.From = fromEmail
3 D* ~, r' ?( H) _2 A6 ]+ W4 ]email.To = toEmail
1 T2 \; Z& r- B. uemail.Subject = subject " _8 Y/ z, Z! E) m" N; x$ A
email.Body = body
( S% ?/ W% K3 s9 ]CCO.Email.setup_smtpmail_server_and_send(email) - M0 s" ~: R% o7 |4 g
3 |( x$ B6 ?& y" H
' Alternatively use the SendEmailToIdentity
9 Y) |( Q0 _2 u6 R1 A9 Z% c' The first argument Is the Identity name To send the email message. ) O& v: F( W/ q
' The second argument Is the subject text. # f6 q2 E+ u: |) N0 ~
' The third argument Is the email body text.
5 T$ d( w4 I3 ^, K7 F, A' The last argument Is a user login name As the sender And
, J! e& o% p' F% f' If blank will use the logged In user name And 5 Q6 ]$ K* p" D$ d' U
' that User Item must have an email address As well.
1 Q- {6 I- E4 a) o0 \* OCCO.Email.SendEmailToIdentity(identity,subject,body,user)
7 d% c$ X; m+ u( Z8 p7 o$ v- I# C2 `
|
|