|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique 7 n. T" i% [% D% p: P" D
Use the CCO.Email object to send email messages. % E% o( |$ a- u, F8 c" k
C#
; U. \: I+ W# |. MSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); # }7 O8 w' V5 P. h; F! F- l
email.From = fromEmail; 8 V+ Z" W7 o$ @3 w
email.To = toEmail;
1 m* ?/ Y( g7 Gemail.Subject = subject; 5 _' b+ H7 Q/ W$ h8 p
email.Body = body; 2 F# u; v( P) V) n3 I/ k
CCO.Email.setup_smtpmail_server_and_send(email);
$ g2 m$ k; {: S . T. A" s) i' M5 E0 Z
// Alternatively use the SendEmailToIdentity
" E5 b! u2 [: r* e4 g// The first argument is the Identity name to send the email message. ) E( ]; @& n7 W* c' a* G# ~
// The second argument is the subject text.
& K7 h4 `( ]4 z// The third argument is the email body text.
* @" k7 y$ W* L// The last argument is a user login name as the sender and ) u3 `3 U2 X4 b0 O- j& n
// if blank will use the logged in user name and ( {) E# x' K/ a9 C- P, K5 Y) E& G
// that User Item must have an email address as well. 9 N$ l' q3 y" t( w& y/ M
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
0 w/ u& [: t# v- Yreturn this.newInnovator().newResult("ok"); ! ?0 O2 c4 z# P( S
VB.Net , y8 R4 M) }7 k! S
Dim email = New System.Web.Mail.MailMessage()
6 L. v) X, Y" v% V- {- Temail.From = fromEmail * E' v) v! @- ~
email.To = toEmail ) {2 e. C i. J/ ^; Y& T4 B
email.Subject = subject
) J6 i6 B- |) T# Cemail.Body = body / ^/ j/ X) G; b4 \- z
CCO.Email.setup_smtpmail_server_and_send(email) 6 U) I8 u8 o9 T4 T+ p+ U7 |
2 Q* Y1 G" Y9 |' Alternatively use the SendEmailToIdentity
$ |( w9 a- A' ~4 e. K, d' The first argument Is the Identity name To send the email message. a+ h' ~) K# u; T, X& `
' The second argument Is the subject text. 2 }$ D. O: g: _$ j
' The third argument Is the email body text.
" C* w5 q/ C$ f! J; R' The last argument Is a user login name As the sender And
3 J: K% ^5 b3 X. D' If blank will use the logged In user name And . L# u, F# t" l% ?: j% m& D
' that User Item must have an email address As well.
; ~% ?! z- R( Y1 cCCO.Email.SendEmailToIdentity(identity,subject,body,user) : e7 E1 ?& ?6 l& V- V$ \+ ]
; K+ d" m% L, [- F0 F3 n0 d& k
|
|