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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
: P& j6 Q% I; q, T* ?7 uUse the CCO.Email object to send email messages. & p! d- W/ @8 ]& e9 L
C#  
& F7 }# x" ?5 XSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); & u# q& k0 A/ u! D  y
email.From = fromEmail; " h9 t3 J; Q9 E' V& ?! N! S
email.To = toEmail; ' g7 B* N2 U- h) e3 j. @) e9 J' e
email.Subject = subject; 2 I4 P" A8 ^% E3 }6 r1 C7 i) Y
email.Body = body; : D0 \/ f1 I) e8 E, x2 d
CCO.Email.setup_smtpmail_server_and_send(email);
/ h# y9 G, |! \: O& J" ^
! {! ]. T9 n0 L: M& R  w' ?" Y5 ?// Alternatively use the SendEmailToIdentity , t, O: e1 i# ^1 G. m9 g/ b1 U' ?2 C: V1 ^
// The first argument is the Identity name to send the email message. 9 k; t% N& I6 v
// The second argument is the subject text.
& u4 Z1 J$ X- S: `/ Y% u// The third argument is the email body text. 6 n7 A* A9 m( T. ?& M0 d: T
// The last argument is a user login name as the sender and ) m( |9 b& t# n2 z) G) M
//   if blank will use the logged in user name and 1 S5 ?; f/ l4 y7 F" g' n& P' {, y
//   that User Item must have an email address as well. 7 B: v2 U  G5 ^* E
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
& o' o7 }( _0 S8 @4 w' treturn this.newInnovator().newResult("ok"); ) R. V& y; Y/ |! @8 v
  VB.Net  : U0 k! ?. l* c( Q3 u1 n4 ~
Dim email = New System.Web.Mail.MailMessage()
# S# D/ x: l7 i' e3 s0 Vemail.From = fromEmail
; N3 P( @7 L* ?email.To = toEmail
) j' s5 Q. ?' H1 I, iemail.Subject = subject # x' f8 N0 I$ ~( R/ m3 f# K: {
email.Body = body
1 \! l+ E; N. K: F- nCCO.Email.setup_smtpmail_server_and_send(email) . ]2 Y6 H  ^8 x. @6 M+ Z

+ _2 D  a* ~& k) j6 m' Alternatively use the SendEmailToIdentity
, w# \* F: O6 E% C9 e3 U+ y' The first argument Is the Identity name To send the email message.
2 h3 S( U2 P3 _* }8 @5 z8 Q' The second argument Is the subject text.
' O0 e+ Z- h; w  q' The third argument Is the email body text. " M. G" L) ?$ j2 Z) v* }: I9 s  n+ B
' The last argument Is a user login name As the sender And
2 o* H! L) D% e# ?9 M'   If blank will use the logged In user name And
3 F6 ^4 |' }3 x( u'   that User Item must have an email address As well.
  A' }* }( Z0 T+ y- Z% ]CCO.Email.SendEmailToIdentity(identity,subject,body,user) + u0 X0 F* o% p  T) I9 V: B

7 h$ J+ i, |& s, g  c% B
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了