|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
Technique
3 E) V6 l2 L* r$ Q; rUse the CCO.Email object to send email messages.
8 u4 m: N4 W$ z1 e# R+ eC#
7 a) O# `( ^$ G$ V! I2 a; S6 p6 FSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ) K9 U3 j* ~" a- F
email.From = fromEmail;
9 W; z4 P. \8 D4 H$ @, v J' jemail.To = toEmail; 1 f5 [6 F: N$ _+ k/ [* R
email.Subject = subject;
- N' [/ j) X& n! O% x+ \9 ^email.Body = body; 4 P* w! T4 S3 u e* P6 v% p
CCO.Email.setup_smtpmail_server_and_send(email); 9 m, c1 m4 y- l; K" V+ D$ Z: q
, x8 d0 b }- \
// Alternatively use the SendEmailToIdentity
& |$ C0 B- A# Q- R4 U// The first argument is the Identity name to send the email message.
% \% J5 e0 R- x% r$ i* p& N B// The second argument is the subject text. ' s2 [+ |2 G( u7 t8 [
// The third argument is the email body text.
" p" s5 h( Y$ `( N// The last argument is a user login name as the sender and % ~/ W6 l9 E; Z8 c& Q3 Y" ~6 C
// if blank will use the logged in user name and 5 d& T& B! G- k
// that User Item must have an email address as well.
/ O$ _# e- d# D3 W, ~2 J$ u" Y8 S( GCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); t7 s X& x: B( k& ]
return this.newInnovator().newResult("ok"); # p$ O8 z7 x, x- h* D
VB.Net 5 s8 c+ ?7 S- q
Dim email = New System.Web.Mail.MailMessage() 3 [! p" Y/ L: w2 K) @
email.From = fromEmail
1 ~/ K, g3 _: R2 E9 [email.To = toEmail
! Q& T- k. n3 Q; V- @; r semail.Subject = subject
5 d2 }2 S9 K+ y- N7 i8 U& b, Z' |" Oemail.Body = body ! o4 i% O0 C( k9 y
CCO.Email.setup_smtpmail_server_and_send(email) , ]7 q# b. { S5 V F: v! p: `2 @
, g/ j8 P7 y7 Y' p! |! ^' Alternatively use the SendEmailToIdentity
- `# \" \4 r S' o& Y j' The first argument Is the Identity name To send the email message.
6 C" u1 G" n+ {* m3 a! k' The second argument Is the subject text. * Y! u L/ E1 N9 T
' The third argument Is the email body text.
- z% v, Q% ?, q* l' }' The last argument Is a user login name As the sender And ! R' @# w; b- r" H3 n. R* B V
' If blank will use the logged In user name And
5 L6 v! w8 Z r/ {' that User Item must have an email address As well.
) _" I4 w5 o( b/ @# [CCO.Email.SendEmailToIdentity(identity,subject,body,user) 0 O$ x0 p$ t& c* P0 {- k
& U9 S t5 H5 j/ J |
|