PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

2018-8-1 14:08:15 3923 0

admin 发表于 2018-8-1 14:08:15 |阅读模式

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  3 N; G% D/ b5 `7 u  R- c
Use the CCO.Email object to send email messages.
& F1 s2 f1 G8 E! e/ L3 d) P, ~( xC#  7 f3 [/ `" w# L# }
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); & Y2 U' k8 m9 b4 Q
email.From = fromEmail;   U: N, {- a8 q
email.To = toEmail;
7 a+ p, d: E2 V% Z3 t$ z0 }email.Subject = subject; 1 g2 j1 \! Y: ]6 P- n
email.Body = body;
+ C- t" ~  L: n. n/ ^  uCCO.Email.setup_smtpmail_server_and_send(email);
" a( k$ S2 M" q) V . G& I  Q8 J) v# d3 z
// Alternatively use the SendEmailToIdentity
. d* z: o9 t- \// The first argument is the Identity name to send the email message. 9 ]5 `+ C* Z$ l' \3 X
// The second argument is the subject text.   d1 A0 |% Y% z
// The third argument is the email body text. , u' n  K# Q7 i+ z& [- Y: N) d
// The last argument is a user login name as the sender and
0 e! q2 S' u; G//   if blank will use the logged in user name and 1 Y3 X* @' P9 V% r: t+ i5 s
//   that User Item must have an email address as well.
' N1 U; l' P' a3 a! R. C# U9 \CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 0 N0 k% C( W$ l% d9 o+ f& g" q$ V  J
return this.newInnovator().newResult("ok");
5 _( a3 ?7 B7 z+ z- C" U& ~% M' u  VB.Net  
0 R+ N. I8 B) [Dim email = New System.Web.Mail.MailMessage() 1 h# }' I' E, G' }& m2 Z
email.From = fromEmail 0 x( h' I* g& y* ?  H& |; z. d
email.To = toEmail
+ s& u9 H5 l* Temail.Subject = subject 5 k! d7 t& a9 w# Q7 n
email.Body = body + w# P: h; c# x* t
CCO.Email.setup_smtpmail_server_and_send(email) + S  ~  p' r3 W3 F4 [6 V
0 n. G( ]2 v: g7 }
' Alternatively use the SendEmailToIdentity % }3 x5 g8 e0 N! r; s, J2 k
' The first argument Is the Identity name To send the email message. * \0 A3 E4 {" Y) |5 r' J
' The second argument Is the subject text.
& f, W7 P+ V* U( r' The third argument Is the email body text. " C: k+ w* V$ U5 c; b
' The last argument Is a user login name As the sender And
$ F/ J7 l+ M1 f0 ~- U'   If blank will use the logged In user name And
5 F' @! H, l8 |) U  _'   that User Item must have an email address As well.
6 W5 v( V3 ], v0 v  }0 _7 [# S- HCCO.Email.SendEmailToIdentity(identity,subject,body,user)
3 n% V+ F7 _5 G! o* t, v
1 x, H/ Y3 M/ s. D( R9 S0 X7 `. _
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了