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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  # S, x. |( \7 z! w. d
Use the CCO.Email object to send email messages. " r3 Y; U# |0 b
C#  0 h+ M5 Y. l# o" n1 _
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); / @$ u" M* t- ]& ?8 e2 g
email.From = fromEmail; ) F- x) s" f4 K, `( S+ v4 C2 F
email.To = toEmail; # t( [( I0 _3 f
email.Subject = subject; 8 S+ `# c/ n5 d2 j$ C
email.Body = body;
# a0 [$ g) C& fCCO.Email.setup_smtpmail_server_and_send(email);
: h, R" ?3 Q; s/ K
4 H4 P7 A' s9 D2 s" X// Alternatively use the SendEmailToIdentity " `: P3 F# t3 n, }. r6 E
// The first argument is the Identity name to send the email message. 6 o3 W$ e0 P* Z; |* S
// The second argument is the subject text.
. Q7 U1 `/ T# X; ?// The third argument is the email body text. . p  f. Q3 N( k6 U+ E( d! y
// The last argument is a user login name as the sender and
& H/ K. B+ u3 ]9 f( F8 i1 K7 q  F. |//   if blank will use the logged in user name and
9 C3 i" _1 Z4 `% d% z9 y$ \' Z//   that User Item must have an email address as well. ) ]+ S& V& C- A0 r  X8 d
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); . _. D3 `" g1 {% f" ]: k# L$ ~6 U
return this.newInnovator().newResult("ok");
; j$ k; j' B0 B( Y  VB.Net  $ C& s, [6 |# }0 }: J
Dim email = New System.Web.Mail.MailMessage() / @* j! T8 |, i# J- e
email.From = fromEmail
3 x7 `0 g) z3 R# j7 Iemail.To = toEmail
7 X8 _" U. A+ kemail.Subject = subject * ^& q" b) m, y  v3 ]1 J1 G
email.Body = body 0 m* H6 C9 z. ^( T/ ^
CCO.Email.setup_smtpmail_server_and_send(email)
/ O+ ]5 I8 a! y7 A
2 |5 e& H* d$ G: O% a9 H4 F' Alternatively use the SendEmailToIdentity 4 n5 G* }# X/ P
' The first argument Is the Identity name To send the email message.
) {$ `) [* W0 Z2 n  m0 @' The second argument Is the subject text.
" Z: i9 d5 R, F' The third argument Is the email body text. 8 ~' j0 `4 n) y6 P
' The last argument Is a user login name As the sender And
6 h: h% M+ r% J4 J$ u: n1 F'   If blank will use the logged In user name And
9 w/ \. E; B% ]' V'   that User Item must have an email address As well.
; C! W9 S8 E% A. H+ LCCO.Email.SendEmailToIdentity(identity,subject,body,user)
9 k. u. s5 \3 y3 D1 |, n7 C- B; I" a# i) K2 @$ T, x
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了