查看: 3975|回复: 0

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

[复制链接]

4

主题

3

回帖

44

积分

管理员

积分
44
发表于 2018-8-1 14:08:15 | 显示全部楼层 |阅读模式

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

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

×
Technique  
3 {# }/ I) J8 v* H0 s/ |8 V, x4 q% VUse the CCO.Email object to send email messages. ' y- Z- e8 A; N  S% U, P: N
C#  5 o* W) w: Z% S' b! Q2 d& {
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
; q) N4 C1 d( o* j* p& wemail.From = fromEmail; ; \! p7 w7 ~# a+ H  d- W
email.To = toEmail; + x# T2 ~9 F. P: D
email.Subject = subject;
8 I8 a$ a( \8 V) Z2 w  Eemail.Body = body;
2 W7 |! u$ S2 _. M) @; LCCO.Email.setup_smtpmail_server_and_send(email); ) t, Y  o  g7 Z( ]

) P, v; F  q1 T$ G  `( L// Alternatively use the SendEmailToIdentity
* |' X( |: A6 v5 y( D// The first argument is the Identity name to send the email message.
  I8 x# R# d3 U. }; x! Y! @- z// The second argument is the subject text.
# R% `: l& N" }5 l1 A// The third argument is the email body text.
1 e8 l, U: R( a& v// The last argument is a user login name as the sender and $ A, z; i# H; ~$ T# N
//   if blank will use the logged in user name and % c' }% ^- f* E* j0 Q8 s
//   that User Item must have an email address as well. 7 ^, m2 l, a1 c; d
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); & Z% ~8 l4 ?  ?8 L+ L% t9 t
return this.newInnovator().newResult("ok"); # W- H1 N2 _# u4 c) T3 D0 B
  VB.Net  + r5 U, |! P% S! G: B
Dim email = New System.Web.Mail.MailMessage()
6 [, t! W0 O* k8 X6 @* W  ?6 ~email.From = fromEmail 3 s* M. n2 R5 B8 j: H
email.To = toEmail
1 Q* \  B- t. P8 demail.Subject = subject
- y: V& n0 f) Bemail.Body = body ) d3 r5 M$ @/ c2 D
CCO.Email.setup_smtpmail_server_and_send(email) ( X7 w8 |) G4 W' d1 ?

# C+ r3 F3 j2 `4 {) a' Alternatively use the SendEmailToIdentity
, J' ?% u' b/ o( V  N' The first argument Is the Identity name To send the email message.
$ _! L& z: [9 _/ i- U. O0 {3 |' The second argument Is the subject text. & ^2 B' r0 d0 K. \
' The third argument Is the email body text. - J/ @: G. d  _+ M
' The last argument Is a user login name As the sender And % g6 v4 y! N; R
'   If blank will use the logged In user name And - z. a* d+ \* r0 M4 N5 y7 Z
'   that User Item must have an email address As well. ' i8 b6 l6 x+ \( ~) c
CCO.Email.SendEmailToIdentity(identity,subject,body,user) - t( j) e, K5 y8 I) @2 D
8 q. E, U* _. u2 Q
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部