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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  ) Q! ?5 k- T6 _7 ]( Z" o
Use the CCO.Email object to send email messages. & X3 ^- F3 r$ p0 v4 D
C#  2 n$ }& u5 w; @  P0 {/ R
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
3 D, O7 C: M* j5 semail.From = fromEmail;
9 A6 c- |6 Q7 A* H7 u/ m9 b6 Oemail.To = toEmail;   k' i5 t- ]* T8 @' g! ^4 Y
email.Subject = subject; : P% I% _% ?5 G. L! w
email.Body = body; * }% P- K/ n' A# m0 |1 X9 r% g, Y
CCO.Email.setup_smtpmail_server_and_send(email);
; S5 S; L% j& o 0 K+ L# W( |) G1 A' U8 P1 y
// Alternatively use the SendEmailToIdentity 5 `) i2 z. C2 e
// The first argument is the Identity name to send the email message. " k7 a& z) \8 V# F/ t
// The second argument is the subject text.
7 Y  v% L8 A% B2 S% Z6 O+ K// The third argument is the email body text. % ]5 j7 f: B5 A4 {. K' d8 |2 F
// The last argument is a user login name as the sender and , Y) K! d* n: }4 c" y$ k
//   if blank will use the logged in user name and * V8 Z# ]* W  p8 ^/ Q, b* N
//   that User Item must have an email address as well.
& c' T, Z8 z) M3 k1 MCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ! i5 W* |6 Z2 i) i5 b
return this.newInnovator().newResult("ok"); 6 Y5 m' u; g# Q6 _
  VB.Net  " E' }1 C1 A& f
Dim email = New System.Web.Mail.MailMessage() 9 \7 |% ?' }: d+ _6 M9 d5 z
email.From = fromEmail 2 D" _& ~4 u0 c, J$ h
email.To = toEmail % e; |" ~" r0 N
email.Subject = subject 5 f1 s: J  ?/ n# X  }
email.Body = body % N; ~, S4 W. u) l, ~1 }
CCO.Email.setup_smtpmail_server_and_send(email) / c% K7 @! ~& e* Y- |2 b4 N

) h: {) I; O2 j& }6 p$ ]8 S' Alternatively use the SendEmailToIdentity - |; `$ _' d; R7 h9 X
' The first argument Is the Identity name To send the email message.
9 Q" A$ _8 D  m, V5 `+ S: ^' The second argument Is the subject text. + g* f& r  `1 K4 y( `2 B7 ], C6 n" g; y
' The third argument Is the email body text. : G- h) b6 N6 a) i
' The last argument Is a user login name As the sender And : y& A. e) m4 l) ~- u. M4 o! y
'   If blank will use the logged In user name And " X! t5 O, C! J$ f+ y
'   that User Item must have an email address As well. 3 {- k0 q: y# ^3 h0 O" O, ?
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
* M* z% z" ~. x" P! _, C6 l, L( C, H" G2 g7 q
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了