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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
0 h0 J& n4 C/ W5 z+ i( F/ {( kUse the CCO.Email object to send email messages. 4 f7 ]! `/ ?5 Q$ b: X7 ]6 Q; X. A, g
C#  ( `7 m6 `8 c9 d3 g8 ]' ^
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); + {  ]1 k7 A/ f. ]7 x7 C7 @
email.From = fromEmail;
' J1 I* F9 U) C# a1 u: k' Eemail.To = toEmail; ! F# j) X; q( [: S/ Y
email.Subject = subject; # |% b" e6 v% I3 v& m1 H" Y3 C
email.Body = body;
$ t" Q' G& o& I. N; D  A/ t" SCCO.Email.setup_smtpmail_server_and_send(email); " ?& b# I# y/ C4 }+ D

) U& H+ g0 w5 R5 Y// Alternatively use the SendEmailToIdentity
$ y0 T! Z6 s' U# O# K3 w1 `- z' W// The first argument is the Identity name to send the email message.
& l- \; o# B; |+ V// The second argument is the subject text.
5 b3 N! P4 w- h0 }2 E" ?// The third argument is the email body text. ' B& l2 w6 F7 z) K7 `
// The last argument is a user login name as the sender and
8 l. m2 E# a6 z: Q8 r# d& f//   if blank will use the logged in user name and
! L/ f- ~  v3 f( J. d, U, v. u2 X( N//   that User Item must have an email address as well.
1 ?, T$ P! b, jCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); + \+ m& T& H3 c
return this.newInnovator().newResult("ok"); # e, q' G8 j4 S% B/ @" N$ n" S' d
  VB.Net  
* a- m  d9 f2 E9 D) A* b! SDim email = New System.Web.Mail.MailMessage() - ~+ F9 u1 d2 d/ g
email.From = fromEmail 7 ^0 P2 O" E! _2 _5 M$ u, B
email.To = toEmail
+ _( |+ i' U1 W; @) E# S  |email.Subject = subject
. t0 v1 D; m/ d3 E% a+ Bemail.Body = body / [9 a+ l1 W. \9 V: @  q! V
CCO.Email.setup_smtpmail_server_and_send(email)
* E5 d6 \- v# ]8 }2 |, y
9 m+ W5 T* r- H' Alternatively use the SendEmailToIdentity ( C1 \5 U" P8 G( q, ?
' The first argument Is the Identity name To send the email message. 6 C3 A, B& A$ `! S2 n# D( i2 P
' The second argument Is the subject text.
. A& N2 h8 i# @1 F! q' The third argument Is the email body text. 2 H+ E- v& I' T
' The last argument Is a user login name As the sender And
/ d' w' R) k/ l$ O. O'   If blank will use the logged In user name And
$ |. C- t* `% [; Z'   that User Item must have an email address As well. 2 d8 s; }- H% t3 d7 c! p# B
CCO.Email.SendEmailToIdentity(identity,subject,body,user) . Y+ O1 l( j5 Y; D  C6 h
6 k2 M- C- L2 I$ o6 E5 i1 L" p
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了