|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique ! A1 i {7 C- S
Use the CCO.Email object to send email messages.
" }' B& K* [8 n5 Z% h, sC# . f! l/ p! E7 h7 I
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
P/ }3 u: x$ x) i# pemail.From = fromEmail;
" ], L( G. I7 p" g! [5 }email.To = toEmail; ! q( I) B/ }: m+ b; ]9 I2 P4 m
email.Subject = subject; & h3 L6 ^1 D4 X4 ]
email.Body = body; / `7 w9 \/ v- f# F
CCO.Email.setup_smtpmail_server_and_send(email);
( ~" p2 A5 @& l2 i6 k % B7 a4 [/ G6 I/ ~# E( u
// Alternatively use the SendEmailToIdentity
( G, R* z( O h7 m9 D, p1 k// The first argument is the Identity name to send the email message.
* t) F+ N" U2 W// The second argument is the subject text.
6 \' C1 z" k: Y2 m# K8 z/ \" l// The third argument is the email body text. * e1 ~2 ~# `" v0 a; e6 P( P' u$ I
// The last argument is a user login name as the sender and $ K, r. C- u2 V- P0 B& f8 {. W* V& P
// if blank will use the logged in user name and 3 j1 h% y' n0 x9 _$ r( o
// that User Item must have an email address as well.
& e: I# ^3 Y. H3 v r9 NCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); % n- C6 i1 Q& e R$ S7 a1 k7 ?1 T( x
return this.newInnovator().newResult("ok"); , W# \1 F4 r" Q* q$ ~* v$ \; | D
VB.Net % n/ N9 o" r0 O& q$ u4 b; x5 S; J
Dim email = New System.Web.Mail.MailMessage() 5 B% ~& G( Y3 b" e
email.From = fromEmail
9 Z: f! r4 m- e l( H, @email.To = toEmail
$ R: ~0 u# e) l4 n6 u/ aemail.Subject = subject . X: b+ a! s" b
email.Body = body 2 G/ n1 v( Y" f0 V; m
CCO.Email.setup_smtpmail_server_and_send(email)
2 V' k+ n2 n9 p1 B* {) G. t) H% a
6 n4 l s# Q1 I' U" U' Alternatively use the SendEmailToIdentity ' l* @8 ?# e) @! D
' The first argument Is the Identity name To send the email message.
6 E( ^6 Z. r! L1 n* M' The second argument Is the subject text.
" Y, O, y7 B4 l. o# r# J8 c' The third argument Is the email body text.
; s! a! k5 o0 D' {4 j' D: X' The last argument Is a user login name As the sender And
" _: K, x' u( g* s5 z& Z' If blank will use the logged In user name And & T2 i2 `# P/ B/ s4 G; D; m# a
' that User Item must have an email address As well.
) W; j2 m8 o3 F# BCCO.Email.SendEmailToIdentity(identity,subject,body,user) * K- _9 ?+ x" U" K/ d' N
0 u/ s0 ]5 `3 Q5 a+ e" a
|
|