查看: 4104|回复: 0

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

[复制链接]

6

主题

4

回帖

60

积分

管理员

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

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

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

×
Technique  
5 N9 O2 G. P. n- R1 FUse the CCO.Email object to send email messages. 6 k4 T/ S& S3 m: C
C#  ; O5 N1 e. u  z0 N% R8 [" Q
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& K' K0 e- u) nemail.From = fromEmail;
9 }5 G. H6 f7 x: {  h! T2 n; Kemail.To = toEmail;
, t3 v/ E; C6 kemail.Subject = subject; ) v: k4 h/ f4 a& V
email.Body = body; 6 b  s! L" v' C- ]( m3 w8 R8 n( V3 X
CCO.Email.setup_smtpmail_server_and_send(email);
+ T3 P; `  z$ L2 l+ u' Y ' m: T6 z5 m) G' E7 F
// Alternatively use the SendEmailToIdentity / l8 ?1 t0 X! \
// The first argument is the Identity name to send the email message. / m% X/ r$ Z9 T0 @4 K8 U
// The second argument is the subject text. 1 [) {5 M3 {0 F% V( q/ J
// The third argument is the email body text.   y8 j% W8 x4 ^! D9 e6 K7 ~
// The last argument is a user login name as the sender and
* W& @4 T& `: f" V//   if blank will use the logged in user name and * V+ [: {* X: R
//   that User Item must have an email address as well.
* w& x8 E3 M# Q5 U" E; ACCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); # M' ~/ l2 p% k
return this.newInnovator().newResult("ok");
: V; I  q+ r) K+ y; E5 k8 [, `- s3 ^  VB.Net  , h$ i( A! }3 |. \3 x8 O8 G8 s& M- r
Dim email = New System.Web.Mail.MailMessage() % V* ~/ X( \" A3 j! M  K
email.From = fromEmail 6 z' n6 e5 c7 z9 p/ n: I
email.To = toEmail 9 e4 Q0 m$ Z0 _7 O9 l3 \1 f
email.Subject = subject / S* O7 M% K2 g: N( s7 g6 ?
email.Body = body
' V' H5 \! C9 D9 K& ?0 a6 {CCO.Email.setup_smtpmail_server_and_send(email)
' o) f: S- ^! ~) B. g* P/ g # _: B3 A. ^7 C0 N  K- _( [
' Alternatively use the SendEmailToIdentity
6 I5 X3 G+ V5 O9 _0 P' The first argument Is the Identity name To send the email message.
" ^1 V; U( C/ j% @  V" |' The second argument Is the subject text. ; s! u' H. l( ?3 Q" w
' The third argument Is the email body text.
2 Y/ P$ c, U# s$ r9 i9 @# O8 P' The last argument Is a user login name As the sender And
$ R" j6 P9 n8 O7 E: y, q: |3 r'   If blank will use the logged In user name And
' c6 _5 \# u& K3 k  I2 u) |2 K6 w'   that User Item must have an email address As well. % k; H" E7 ]3 w8 Q
CCO.Email.SendEmailToIdentity(identity,subject,body,user) ( k) u5 v6 m7 t7 y

9 T9 j; s  j  ]% ~" w$ {. M
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

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

本版积分规则

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