PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

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

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

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

x
Technique  + f" r" l% S6 O0 c/ b" Q
Use the CCO.Email object to send email messages. 5 Q0 l3 Z" W" y
C#  3 e$ v  s$ K$ K# ]' H
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
9 r, ^4 V; p( [* r4 z+ S4 v$ o0 }email.From = fromEmail;
* {! f/ |- L+ O7 kemail.To = toEmail;
0 y5 [1 P% B. Uemail.Subject = subject;
7 Z) \- _- [- t. |, bemail.Body = body;
$ \: o, c- [, `! F+ CCCO.Email.setup_smtpmail_server_and_send(email);
+ \! `7 e5 U& r; S" @! G3 e
8 N& C0 v( p9 ?! b( F+ u6 Z// Alternatively use the SendEmailToIdentity
$ u1 M4 @, m4 e2 t" `// The first argument is the Identity name to send the email message.
" {7 _2 }$ W! ?  e; [( U# @// The second argument is the subject text.
$ n% L1 V, n' }+ c# o% a// The third argument is the email body text.
7 C6 u$ @) v% ]- j// The last argument is a user login name as the sender and
2 u) I' o, ^) P6 f+ n' T$ F//   if blank will use the logged in user name and ' b+ K0 g% s5 {/ J& x0 Y  U; o
//   that User Item must have an email address as well.
( s  A, V9 {( Q+ n7 J8 ]CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
5 e+ v$ V& R$ l$ Q8 Hreturn this.newInnovator().newResult("ok"); 6 g. v6 j1 t4 O5 m/ k
  VB.Net  # C% a; D4 p9 C' H# \6 o& E  e
Dim email = New System.Web.Mail.MailMessage()
( F" l8 y- U2 T8 n' S4 Xemail.From = fromEmail * P2 V) J# m" [
email.To = toEmail
4 k: m( c! s  K  yemail.Subject = subject * @% k; i( q) ]; ]! {2 L; n& w% v
email.Body = body
5 j+ E. T3 L8 a* r! z& v" W: m; uCCO.Email.setup_smtpmail_server_and_send(email)
8 V% @6 h3 ~. O4 l; f; K - F4 P* z: p; U! J. L4 I$ m. a$ Q/ x
' Alternatively use the SendEmailToIdentity
0 U9 m$ K) }  {9 M' The first argument Is the Identity name To send the email message. + k8 n  Q. ^6 g1 R0 n: e) K; T6 b0 J
' The second argument Is the subject text. - S* P8 o. F) A" o) P) M( X
' The third argument Is the email body text.
! l  L( W3 r2 B6 a, f6 x4 h' G' The last argument Is a user login name As the sender And $ q  Z2 T8 E: ?* C, l2 @. s
'   If blank will use the logged In user name And
- L2 s% Y6 D! e* [9 A$ p'   that User Item must have an email address As well. / M3 [8 U7 g  G
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
, Y7 g4 W' S( b# r( y  |
0 E2 a1 n) y$ C5 s/ @4 J$ G8 T, T
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了