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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
8 U$ @# G0 j# WUse the CCO.Email object to send email messages. 6 Z4 L0 y8 P* ?1 P; M! d9 ]7 P9 H
C#  * B6 A: o* n) C3 N; s" n
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
) v3 u+ Q% X$ b- demail.From = fromEmail;
0 L1 ?6 T8 _- L3 p# l4 Temail.To = toEmail;
8 ]" r- n/ n* S/ _2 k$ y3 ~0 bemail.Subject = subject;
* n$ A4 L, Z0 J9 Pemail.Body = body;
( M( R& |; f/ ~$ `/ gCCO.Email.setup_smtpmail_server_and_send(email); $ ]& B$ z1 ?/ a& x0 _* u
$ K% M  E* z, ?# ~
// Alternatively use the SendEmailToIdentity
6 X$ Z" s( m0 c$ G( o: P0 N% N// The first argument is the Identity name to send the email message.
+ j% e# E7 W7 E( b* M# f) F// The second argument is the subject text.
! }' O+ u2 p+ u' O, B// The third argument is the email body text.
& U0 P* |# N+ W0 K3 U3 s6 S( F- _/ R// The last argument is a user login name as the sender and
  J0 ?; n8 A1 Q& v0 L$ V6 b//   if blank will use the logged in user name and   _, X6 j* [3 Y, d7 i+ i
//   that User Item must have an email address as well. ; X" G0 z& O7 [; a1 r" U! n
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); . @& c9 g6 L% C2 U/ A0 ]- |- H8 H8 ?
return this.newInnovator().newResult("ok");
6 S" H0 I% v5 R6 }6 I  VB.Net  
: U9 _$ u+ S; t. A+ _9 J" _  ]6 \Dim email = New System.Web.Mail.MailMessage() , ~, u% u* o& F- \/ `" ~* |# h, t
email.From = fromEmail ! n* `2 g' _1 B
email.To = toEmail " D# i* x) i9 W! _. g% i
email.Subject = subject ; ?2 Q: X) Q0 R* k* O
email.Body = body % a* U3 D% C# x2 t4 \7 O4 v3 X
CCO.Email.setup_smtpmail_server_and_send(email) ) H- S* Q8 H# E% d

# J$ e/ p/ |+ ?5 k- N! Z5 i/ l$ j' ?' i' Alternatively use the SendEmailToIdentity
* l/ k$ A+ R" `( m! Y' The first argument Is the Identity name To send the email message. 2 C) t5 V3 y' B" o: M! W
' The second argument Is the subject text.
! Z# S; [9 ^% d' The third argument Is the email body text. - d* Z/ s9 D7 _( U# }5 ~; C0 f
' The last argument Is a user login name As the sender And ' q' g9 Z% N- w6 n7 p. u! E
'   If blank will use the logged In user name And
% Z0 u# T/ K* _# d2 U'   that User Item must have an email address As well. / f+ l4 Q+ @5 S( F0 s2 K( N* {
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
0 Y/ y  e. O, u% v' F; ~6 K% ~! _0 u9 M' n2 s' E
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了