|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
( b4 A" I- H* k( bUse the CCO.Email object to send email messages.
" `' U0 o5 [$ cC# & N' i- q9 I# D6 q
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
; x$ H7 y0 j- K1 K) q0 Y cemail.From = fromEmail; 3 B: q( k3 }0 L3 R& d
email.To = toEmail;
1 e: b7 `- a5 ]; E0 P, Femail.Subject = subject;
: k8 w1 o9 k. H! cemail.Body = body;
; \" p y# G/ J8 K8 R* Z# cCCO.Email.setup_smtpmail_server_and_send(email); ) I" O8 N/ {9 M# V' |
. }- G, x, s5 u
// Alternatively use the SendEmailToIdentity
) a# s q9 y2 y// The first argument is the Identity name to send the email message. J) P9 _/ p. b5 a, W z. \* x
// The second argument is the subject text.
/ \4 y4 W/ @* B" A// The third argument is the email body text. # c* n' X) P: }* p; j
// The last argument is a user login name as the sender and
( c( n9 v* \) q# T$ I2 p// if blank will use the logged in user name and % u4 r0 ^3 a# P+ f, F
// that User Item must have an email address as well. 5 }8 ]1 b. c: c( d: v2 [
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 1 c! U* r1 V- N ^! y u, D2 Z+ J3 B9 O
return this.newInnovator().newResult("ok");
9 l; S8 \0 Q" P: g: }) c, b VB.Net
* N, L8 K3 d. t! h9 YDim email = New System.Web.Mail.MailMessage()
6 O* G7 X: O' ?$ q. _6 O( eemail.From = fromEmail - f+ A+ N8 N4 ^/ s: h& {
email.To = toEmail
2 ~ l7 A6 k; S- memail.Subject = subject ! n4 K+ {( E. H& r6 Y
email.Body = body
" W! t9 r/ s7 c' w# g* n" o5 LCCO.Email.setup_smtpmail_server_and_send(email) % t9 b2 ]# ?# F5 s! j9 d8 C0 v9 E
1 U t W) i2 [" `' Alternatively use the SendEmailToIdentity
' S5 }; M0 O# J! `( w2 \' The first argument Is the Identity name To send the email message.
3 Z" W# H3 C' M* n' The second argument Is the subject text.
, V' g# x6 F4 E1 Z) u6 T9 {' The third argument Is the email body text.
& o) O* |8 W( n- `' The last argument Is a user login name As the sender And
# n, b- N" c" {. o) k8 j5 u/ k' If blank will use the logged In user name And
* e( I( q. q1 a6 v0 X' that User Item must have an email address As well. 9 d1 X: m: K: k5 k
CCO.Email.SendEmailToIdentity(identity,subject,body,user) / m- }# k4 O1 ~3 p$ j" W
" \, y! B/ `. G |
|