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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
* z1 }0 W, I* m9 @Use the CCO.Email object to send email messages. " _" T; a) ^  j! g: ?. {0 v
C#  
' |5 N6 x2 n; P5 T- d) O, tSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); : U1 m- ^% \7 x( `7 Z6 Y& G
email.From = fromEmail;
' ~9 Y; Y2 M9 y: S9 @% o, nemail.To = toEmail; 3 Y0 n5 J, n0 h% o) _
email.Subject = subject; ; B# l) b7 f; s+ F
email.Body = body;
6 l& ~2 I- q- e3 uCCO.Email.setup_smtpmail_server_and_send(email); 1 J0 {& o! n; O# m3 S) [& }7 @" F" ^
! j+ p3 @( z% i3 ?+ l+ \* ~5 h
// Alternatively use the SendEmailToIdentity & `2 r6 \! p+ i7 y6 P4 u
// The first argument is the Identity name to send the email message.
  D7 q1 v2 f/ r- D// The second argument is the subject text.
* _# f4 X) R& c// The third argument is the email body text. 3 L) X: p% ?$ I1 n
// The last argument is a user login name as the sender and
( R! _1 Y: k) h9 z//   if blank will use the logged in user name and
! `/ o" x. D3 p- R" D//   that User Item must have an email address as well.
1 }6 S7 {7 h7 c. A9 D& w6 J" sCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 1 I& E; g7 q9 h  G2 k
return this.newInnovator().newResult("ok");
, L( m7 S/ a8 _9 `4 |  VB.Net  
9 w" @$ D) _) l& JDim email = New System.Web.Mail.MailMessage()
2 \: r( W" ?4 O- [# @email.From = fromEmail
& X- E0 L% p9 x: N/ pemail.To = toEmail
, V4 L) a, e/ A0 k1 t( \9 F0 Y4 qemail.Subject = subject ; D! J5 V) C) k) _9 z. N
email.Body = body * |4 P' s0 ^$ L6 d. [# g) w6 T
CCO.Email.setup_smtpmail_server_and_send(email)
8 @. {4 i0 \; \" P1 o' v
/ n( a' K1 ]; {; _0 A) g8 y( l5 l' Alternatively use the SendEmailToIdentity 8 W: \; p# C  Y% A* {$ p5 X
' The first argument Is the Identity name To send the email message. 1 M1 E  G3 G) J; S9 e
' The second argument Is the subject text.
4 R0 ]7 @+ q1 K  |) W, h' The third argument Is the email body text.
! ~1 d5 C1 Q8 z3 [+ B) ^, Z2 M' The last argument Is a user login name As the sender And
! V! s1 p7 Z/ ]8 Y+ |'   If blank will use the logged In user name And
+ i- M3 Q! n2 ~* \'   that User Item must have an email address As well.
& }3 L* y' U2 B4 l' DCCO.Email.SendEmailToIdentity(identity,subject,body,user)
0 a* b. G/ N: y+ C2 A) u8 q  t3 H+ F8 l0 i
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了