PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

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

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

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

x
Technique  
4 P% k) O, q* g; l+ O3 E! [Use the CCO.Email object to send email messages. ; j# z) q. T1 u( F0 P- L
C#  ! z$ z- Q8 K0 S0 s. i6 u/ x8 o* H3 @0 ]
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& L2 k  A( G( H, Aemail.From = fromEmail; $ @: r. n6 ]- u8 W" }; \
email.To = toEmail;
  p4 f9 A- Y8 G0 O7 F6 p' ~$ `0 c5 Aemail.Subject = subject; 6 ^2 w0 ^- d" O; |. \2 c8 p
email.Body = body;
  U) O7 {  J8 J; CCCO.Email.setup_smtpmail_server_and_send(email);
" P  @( B3 K. S
# Q' b7 I4 W" U# m; W* {// Alternatively use the SendEmailToIdentity 8 N& W- a) U8 d
// The first argument is the Identity name to send the email message.
* |. s8 E8 A! w! F( [// The second argument is the subject text. 3 y# ]3 j2 h) W- }! ?0 y
// The third argument is the email body text. 9 O' ~1 [) J) W: [4 X
// The last argument is a user login name as the sender and ( ~: Q$ T; f9 G! Z; ^" a: }$ U# A
//   if blank will use the logged in user name and
. y$ r* ^( I+ }4 E  V3 }/ P" o//   that User Item must have an email address as well. ' s: Z+ \, d; x4 x7 o1 P2 ~' @
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 1 C* R( w* G. ^+ ?# H4 O
return this.newInnovator().newResult("ok");
2 p' j- D; |4 {8 o7 s5 {0 @  VB.Net  9 k' L& O3 L; z$ Z, Q4 h2 }! G7 y
Dim email = New System.Web.Mail.MailMessage()
8 K" l/ i" c; K% B) F+ d1 `email.From = fromEmail 6 I+ K% t4 }& c
email.To = toEmail
2 l4 z) D- p: Q+ S3 P, eemail.Subject = subject " _1 k. ^+ b& F+ U5 M. Z
email.Body = body 6 [. N# ]3 ?7 |% `1 h
CCO.Email.setup_smtpmail_server_and_send(email)
0 M% e8 T1 V0 ]1 K " R) ~2 E+ k9 J. g) j7 O) ~; C
' Alternatively use the SendEmailToIdentity
1 R! i4 ]$ @5 V$ c- |/ [3 r4 M4 W( x' The first argument Is the Identity name To send the email message. 3 Q  f2 L- |4 f$ J! h9 Z
' The second argument Is the subject text. , j3 s$ R: ]! U7 x1 L
' The third argument Is the email body text. 9 l5 j' V6 R) u- F8 m! [; O2 C
' The last argument Is a user login name As the sender And
7 l; ?, S* R; i1 l5 U% r6 x'   If blank will use the logged In user name And : C  w8 [3 u* K. @* S: a  X
'   that User Item must have an email address As well.
9 V) }" ?  b! f% J, T& sCCO.Email.SendEmailToIdentity(identity,subject,body,user) ( Z% \0 K" X) y# t

/ s9 s$ p2 U/ R) k
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了