查看: 4077|回复: 0

【Aras二次开发源码】服务器端发送电子邮件方法

[复制链接]

6

主题

4

回帖

60

积分

管理员

积分
60
发表于 2018-8-1 14:08:15 | 显示全部楼层 |阅读模式

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

×
Technique  " [. {* o$ T, a( d+ y/ t5 q
Use the CCO.Email object to send email messages. " ?  G! L$ Z' i+ f$ m& z7 K
C#    q  b1 w! Z& ^! t* V
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
! k: O* F( E3 V, V" Vemail.From = fromEmail; 2 y+ G; C/ \) Z( t
email.To = toEmail; 6 a( _% x% D! B/ W; P5 s
email.Subject = subject; + C% ]5 q6 X+ O+ V5 Q. ~$ ?1 K
email.Body = body;
8 t- m0 j  m  C- wCCO.Email.setup_smtpmail_server_and_send(email); 6 Z( i8 {. O3 X9 }
6 \& ^# Y4 i) i& Q. K
// Alternatively use the SendEmailToIdentity
+ W* V1 O$ g5 d+ J// The first argument is the Identity name to send the email message.
' n1 M/ N! U' e; a// The second argument is the subject text. % f' a- G1 R, P8 ^- d
// The third argument is the email body text.
* N' Q7 p+ @( V// The last argument is a user login name as the sender and ' S9 F  G( n- T5 N
//   if blank will use the logged in user name and
( C9 O7 e; w: j0 h0 a( z//   that User Item must have an email address as well. # e+ ?5 [5 o/ u- T
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
8 P/ J: T9 X% Q5 {5 c! zreturn this.newInnovator().newResult("ok"); " L5 ^: K6 c4 G# ?/ M. f
  VB.Net  
0 H5 B* G+ Q$ G1 b; f0 BDim email = New System.Web.Mail.MailMessage()
8 g6 [' t3 ^' H- o% u* h. g# c- Bemail.From = fromEmail 1 w( ?, z( f& H' x7 ]( N
email.To = toEmail
! U( e1 H. ]. J' \email.Subject = subject & L  ], a; v+ a  j9 ], Y. ?
email.Body = body
+ B, B0 u0 e% L8 ^4 ?/ W3 BCCO.Email.setup_smtpmail_server_and_send(email) $ d2 D, M0 G/ A- g# `# v  H& B

( {. Y& g4 a: b5 B! C3 |- x% a' Alternatively use the SendEmailToIdentity # N' q4 r) p- Y+ n/ e
' The first argument Is the Identity name To send the email message.
, i3 W9 _6 i3 u' The second argument Is the subject text. . i" }3 v0 c5 u1 U9 ?) [
' The third argument Is the email body text.
9 B( [# M) ^6 a4 G, z% C' The last argument Is a user login name As the sender And
0 B7 D7 l5 W8 ?& o0 }4 @( O" S: u' {'   If blank will use the logged In user name And & a! p+ e4 P% ^7 G
'   that User Item must have an email address As well. 6 U9 k% p) |' u5 l
CCO.Email.SendEmailToIdentity(identity,subject,body,user) , g2 {% @* f$ J' ~1 S
7 D3 u( q  G( |( ?. v  e  n
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部