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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  1 I6 d  ?1 \! q- y! Q2 R
Use the CCO.Email object to send email messages.
/ r3 b, `' E) e/ T+ TC#  % b+ p. L9 r6 t1 Q) B
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); , |5 I' i- X$ f) d0 {
email.From = fromEmail;
- q4 N: j  c# l2 t/ ?6 @email.To = toEmail; ; v1 Z, _) S/ a0 ^- b) W
email.Subject = subject; " {9 ]+ n' {) b2 U$ ~, ~
email.Body = body; 6 a3 Y6 p+ \, g/ V  _' X' d
CCO.Email.setup_smtpmail_server_and_send(email);
$ {, q( b' p6 K6 h9 ]! P) {3 Z 4 K1 p7 C1 C. N! \4 _
// Alternatively use the SendEmailToIdentity
$ A# @* V8 I4 Y6 X4 X$ k// The first argument is the Identity name to send the email message.
* n5 b# U% u+ f; R. H+ _// The second argument is the subject text. 1 S8 [1 N; J! y: h; C, z6 h
// The third argument is the email body text.
! O9 o# ]5 Z; D% K// The last argument is a user login name as the sender and
% k5 S# Z2 e9 k! W//   if blank will use the logged in user name and / L% P5 i9 i+ J" }: z+ a
//   that User Item must have an email address as well.
: M; B- \3 E, e1 O$ lCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); * }; v' V" q( I2 C3 ~
return this.newInnovator().newResult("ok");
) s$ f0 o: f% t& I; Y2 j; C7 m  VB.Net  8 ?# j7 c- Z& f  Y
Dim email = New System.Web.Mail.MailMessage()
( @1 [/ i& o0 ^/ @' ~% f$ uemail.From = fromEmail
; v% s+ S/ f7 [# \# @1 D1 @email.To = toEmail
; c8 L- J2 N, E; R4 H  _+ lemail.Subject = subject
4 z* ?3 ?! H/ n/ p! Uemail.Body = body & R) f5 Q9 |) Y, m! S
CCO.Email.setup_smtpmail_server_and_send(email)
/ u3 s  y# P# [ $ m1 A; S# X( G+ c8 H2 O
' Alternatively use the SendEmailToIdentity
2 v  m2 f  b3 ~6 O3 d5 Y; j' The first argument Is the Identity name To send the email message.   y! O) _% U3 v/ V8 ]. K5 M$ f
' The second argument Is the subject text.
9 O3 F" S# O" G& m. }8 X" p0 n' The third argument Is the email body text. & L! E0 Y: ?. W) _8 v: H
' The last argument Is a user login name As the sender And
( z9 e( U) E. e( ?'   If blank will use the logged In user name And   L8 O" ]9 W8 V- K* O6 o- x  j
'   that User Item must have an email address As well. " }5 `7 J2 i7 g5 F/ [  @
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
4 C$ s6 s- R* u
* |7 I* I0 h# B/ f+ L3 j5 _
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了