|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
% ~5 @6 V6 X9 B# Q( FUse the CCO.Email object to send email messages. " o: G, W2 p% @4 K+ n/ {8 s/ p
C#
$ K( |( W3 |- {; ZSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
3 c J! ^$ i" Cemail.From = fromEmail;
, i/ c. p* V' ^5 C Aemail.To = toEmail; h" c W, R- m5 W3 E! g
email.Subject = subject;
C& g" ^) X0 W# Hemail.Body = body; # t2 j3 `8 C8 [$ ~
CCO.Email.setup_smtpmail_server_and_send(email); : T8 I8 k3 j7 N7 B. S$ A
" i7 ]6 B% Q: K0 H2 k6 s// Alternatively use the SendEmailToIdentity
* Y5 I; e$ A' L0 z// The first argument is the Identity name to send the email message.
2 |5 |5 \) q& m8 B// The second argument is the subject text. 8 V1 q& f4 Q; q3 X Y
// The third argument is the email body text.
0 W) C* E {1 m: a// The last argument is a user login name as the sender and
4 ]4 g- z6 X8 E1 O+ k* ]// if blank will use the logged in user name and
7 R0 f8 {) D& w// that User Item must have an email address as well.
( `, _/ P) K$ C0 `CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
+ m1 N/ B3 t1 y. xreturn this.newInnovator().newResult("ok"); , z' E. v' w, i* T" F) i- E \
VB.Net
. ~4 p- ]$ F6 ?4 g+ k2 h, ^/ |+ m$ ]Dim email = New System.Web.Mail.MailMessage() ( T2 p* W$ R: o/ P
email.From = fromEmail ) |* R, g( ~! U) ~/ f. R
email.To = toEmail * Z L/ P/ F0 i) |6 j, |" R( J* L
email.Subject = subject
7 B9 `) Z; P/ D. l6 s8 s7 [2 ~/ T Semail.Body = body
. u& S" _5 ^/ K" C/ J" iCCO.Email.setup_smtpmail_server_and_send(email)
: J( M8 O. q9 W
; L9 w0 d; b# S+ L: E' |, n- `' Alternatively use the SendEmailToIdentity
% n* d% F7 j k' The first argument Is the Identity name To send the email message.
" a5 g7 v# z. _) n' The second argument Is the subject text. " X {. s9 t! p$ u" Q+ y) p
' The third argument Is the email body text. 7 R; y f/ F5 [5 g) Q" W
' The last argument Is a user login name As the sender And # i! x) B, A/ x
' If blank will use the logged In user name And / P3 | X8 h, |8 {
' that User Item must have an email address As well. 0 B$ Y3 p( T0 i/ I {5 K! H$ J
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
# J0 f$ ~) w* `. X7 ~0 J9 S% g. H% S( X$ W. R4 M2 {
|
|