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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  4 L& t. Q: K- u' }+ o* J- h* ^/ n
Use the CCO.Email object to send email messages.
7 ?4 c- |2 P) OC#  
' Z" A3 q- x+ k( t- gSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
, M& G' |( j, A$ K2 \+ semail.From = fromEmail;
: O; ^( q9 c* x/ k3 L8 Temail.To = toEmail; 2 ]( K  N2 j0 R* @
email.Subject = subject; 3 m9 H- {# ^" j
email.Body = body; 3 z4 X8 {! t: Z! a$ K
CCO.Email.setup_smtpmail_server_and_send(email);
% o" Q) O# _1 A1 x* k$ ?. x
' i# J/ _0 Y4 T/ {$ U( W# q// Alternatively use the SendEmailToIdentity
$ n6 k# C! |& V! S: ]0 H! v// The first argument is the Identity name to send the email message. ) r% s! v2 b4 w
// The second argument is the subject text. / Q2 _# g3 o: W2 u' B
// The third argument is the email body text.
% m5 P/ f: s( i4 t( X( ]// The last argument is a user login name as the sender and
7 F- R- p- L( y# n; Z0 t( E( X//   if blank will use the logged in user name and " J2 F5 f4 R0 T' H8 u! c
//   that User Item must have an email address as well. 3 O& d. r5 _/ y( j% R, r
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
6 S! T3 `- v3 K3 Y3 Vreturn this.newInnovator().newResult("ok"); 6 K+ S; U, ?0 @& ^  T( T
  VB.Net  
! V' j8 Z) w, g0 O6 O2 V/ {Dim email = New System.Web.Mail.MailMessage() 7 ]3 I) |2 c# C
email.From = fromEmail
0 X, V% v5 m2 E1 M! b6 t: _5 d1 B: Bemail.To = toEmail
- x- J) ]3 d8 Z# Jemail.Subject = subject + A' y6 V; ^! W' \5 @6 X4 F
email.Body = body
0 N9 i2 I' u! Q( a2 `6 o) r, O, qCCO.Email.setup_smtpmail_server_and_send(email)
1 c6 L: J  g  ^
, J( [1 G5 @& s) ?' Alternatively use the SendEmailToIdentity
* L; b8 G& Y$ _' The first argument Is the Identity name To send the email message.
. H/ v4 U- E& v# ]' The second argument Is the subject text.
" e" t* C8 U$ X# U' The third argument Is the email body text.
# Y! s/ W7 G  l1 t" G. U' The last argument Is a user login name As the sender And 9 x. A& X- S/ R5 _0 Q* G
'   If blank will use the logged In user name And / F7 m7 H+ u4 f  u
'   that User Item must have an email address As well.
: I3 n5 n; h* u! lCCO.Email.SendEmailToIdentity(identity,subject,body,user) # h" a/ H: r( m8 p

3 H  x9 e# F. L  k0 W8 i
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了