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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  / L3 |# g5 \6 w, l1 |% j3 ?, |0 |
Use the CCO.Email object to send email messages.
% r3 E- z! r) q& S7 a6 k3 `5 oC#  : U5 L" _; r  s' W
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
/ t7 Q0 h. P$ Q( U$ P; W' kemail.From = fromEmail;
; p1 L7 A& |6 {( Y7 B$ X! lemail.To = toEmail; : o2 r/ E5 K6 E8 n; v
email.Subject = subject;
7 \" ]1 }+ t" z- N; V6 }email.Body = body;
& }& T! K& v1 J* uCCO.Email.setup_smtpmail_server_and_send(email);
+ `) z, ]3 ~, d7 w" i / E1 p8 C; f5 L5 A, R/ \
// Alternatively use the SendEmailToIdentity * e' f+ r7 b+ g! t
// The first argument is the Identity name to send the email message.   \" l9 t/ B0 ~4 b2 h
// The second argument is the subject text.
/ \/ D% S* |$ A1 S, u// The third argument is the email body text. 0 d- I" a! @( b' D) x- }7 U9 g
// The last argument is a user login name as the sender and 5 `! H" v6 u( _! B( N* n' q  t
//   if blank will use the logged in user name and
: Q0 R3 F: l9 P3 \' [5 {//   that User Item must have an email address as well.
* i4 C" V2 |& z6 [! ]CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ) P" [- e. A) q2 `9 A3 Y/ u- `! @
return this.newInnovator().newResult("ok");
$ t/ C1 L1 L8 v  e  VB.Net  
  C1 q4 ]7 i2 [, \' @2 Q7 TDim email = New System.Web.Mail.MailMessage()
+ d( C5 X/ ?4 v6 a+ m& z/ [email.From = fromEmail & m- x, A  K! y' L2 q) i& x
email.To = toEmail 9 Y$ ~1 [& f# y" S
email.Subject = subject
/ C0 A! }0 O3 |8 Q$ ^. p7 n! T+ Oemail.Body = body   c. h6 m3 c. i9 |/ x) J  L5 w3 V. a+ G
CCO.Email.setup_smtpmail_server_and_send(email) 8 `0 k& P# X$ t2 h4 C' t' m
! [1 E6 P  h! N6 Y) @
' Alternatively use the SendEmailToIdentity * }& A7 |% z( U1 C. z0 B- H
' The first argument Is the Identity name To send the email message. ; k# o2 f4 t  e2 u; ~
' The second argument Is the subject text. + u7 }, w1 k9 x" O4 g
' The third argument Is the email body text.
0 K+ I% V, B  [' The last argument Is a user login name As the sender And   J/ h8 T6 W  O( F) ^! [
'   If blank will use the logged In user name And ! Q4 T. B/ V% H$ G4 e
'   that User Item must have an email address As well. 1 d/ M# ^6 t/ ~; u9 X, S. B
CCO.Email.SendEmailToIdentity(identity,subject,body,user) " W8 u) o3 K2 c0 S- O. |
9 Q' B/ V4 M3 V9 V. U! T! P5 |& 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二次开发专题模块培训报名开始啦

    我知道了