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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  % ?4 T) L; p4 E3 \
Use the CCO.Email object to send email messages.
# a% Z: o4 \$ ]8 [; x/ y: _C#  
: V% n' T3 ~* s& eSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); % N# b- F6 O7 j0 j* v2 G' I& J
email.From = fromEmail;
. T) d: Q2 h: r. Memail.To = toEmail; % k( m/ J$ W0 X1 _2 `5 w) G8 D* p
email.Subject = subject;
) o; `! B  X: p& v2 aemail.Body = body; * D$ Q+ N! Y8 b# m. Q0 G
CCO.Email.setup_smtpmail_server_and_send(email);
( y; l. ~$ e/ P/ p 1 a+ B/ }8 u, ?* v3 G( m; M9 ~
// Alternatively use the SendEmailToIdentity 9 X: F( [* E9 Z0 ~
// The first argument is the Identity name to send the email message.
# h& p9 d5 c. C' N1 [// The second argument is the subject text.
2 ]3 X( I% `& i// The third argument is the email body text.
+ f0 \1 e0 _& O2 T) q! \, `3 @// The last argument is a user login name as the sender and ) p+ l0 `% F( b
//   if blank will use the logged in user name and ' D2 f! G' Y! q# f1 I
//   that User Item must have an email address as well. 8 j: C3 P4 o# ~3 N
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); $ \  |/ Y/ N$ P6 h
return this.newInnovator().newResult("ok");
$ N1 k2 c& N9 p6 e$ N  VB.Net  # \! }# f4 m+ D( W8 K8 g) r, E# ~
Dim email = New System.Web.Mail.MailMessage()
9 ]/ |+ G# F1 y# Q7 e: A% _email.From = fromEmail
9 L" i/ w3 e# d4 M; _email.To = toEmail ) J" k: S7 ~; \/ `0 ~2 r1 ~  M
email.Subject = subject / Q* i3 T) a/ M
email.Body = body
$ \- r; k6 E9 }/ r+ r5 uCCO.Email.setup_smtpmail_server_and_send(email)
& J+ \" s8 w# n
1 S2 I( ~, m; B- }1 z- B' Alternatively use the SendEmailToIdentity 6 ?6 }/ M, H( b* ?5 H' v
' The first argument Is the Identity name To send the email message.
' j( W3 o. n( ^* \$ R' The second argument Is the subject text.
2 M( x8 W% R; I/ g0 q) {' The third argument Is the email body text. 6 Z& X" |" i* q2 u; j& v; T
' The last argument Is a user login name As the sender And 6 \! T5 ?+ U6 ?3 O
'   If blank will use the logged In user name And
7 C5 @- q7 g7 ?9 o'   that User Item must have an email address As well.
$ H/ J) \/ y% q9 |2 O7 {' K- TCCO.Email.SendEmailToIdentity(identity,subject,body,user) 6 u& y: P5 f) R/ e" `5 \

4 {5 T: u2 D- ?9 y' t6 S' y6 C9 ^! M. S
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了