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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
0 w; G7 N0 _: V# {: _0 WUse the CCO.Email object to send email messages.
4 Y: s3 u' N3 C: LC#  # L# e, L7 `* A7 }
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
8 l7 Q, D. m; K8 E- I. R  Y+ Q: ~email.From = fromEmail;
7 v" I5 a% g( oemail.To = toEmail; * J5 I/ r4 w. f8 }' M; G
email.Subject = subject;
$ J8 ^# a% u7 o1 M$ z) N' bemail.Body = body;
; v, C7 c3 r8 E3 g4 D9 a, tCCO.Email.setup_smtpmail_server_and_send(email);
5 }5 `7 e( C: k& k
4 l& C# c/ {. z# M// Alternatively use the SendEmailToIdentity 4 ?; ]. `: r8 q! J0 A9 |$ B
// The first argument is the Identity name to send the email message. , x7 \( Y# H# ?5 b; n& f) {6 |& c$ y
// The second argument is the subject text. : k9 @9 f2 @! ^) _: P, I
// The third argument is the email body text. , ^: L  m* Z, @4 c, o
// The last argument is a user login name as the sender and
1 n  i# `) v; Y' p//   if blank will use the logged in user name and
4 e) ]- ]: ^+ e, K# |//   that User Item must have an email address as well.
$ |  f( O, p6 U# ZCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
- p* ]% ~* q; ?return this.newInnovator().newResult("ok"); ( E8 z+ O# S4 d6 `4 |* P
  VB.Net  
7 Q0 C5 a: C0 @. b$ n) qDim email = New System.Web.Mail.MailMessage()
" H: R1 a2 m# d  O. N, ?% n* Vemail.From = fromEmail
6 w% H# K  E# M8 f; ~email.To = toEmail ; B' G: P7 Q" O
email.Subject = subject / ^: b5 Y9 w+ R: L. b: i
email.Body = body
8 _$ s9 y5 _0 q! R& u/ U, iCCO.Email.setup_smtpmail_server_and_send(email)
+ o8 s- H% s; |6 }% P 9 C5 J" I- ]. Z8 O4 Q  t3 K. ]
' Alternatively use the SendEmailToIdentity
, w9 u  u% h( f3 r1 ~, s' X2 ]' The first argument Is the Identity name To send the email message.
+ g! P6 i$ m' L1 f' The second argument Is the subject text. - _, H- I5 J' y! b5 C  R7 l
' The third argument Is the email body text.
5 I' p: B+ m8 A6 i' The last argument Is a user login name As the sender And ; ~& |: k- J; F. C) n) b
'   If blank will use the logged In user name And
3 d: j' [2 q& o- c, y9 m6 g& S0 o- A1 Y'   that User Item must have an email address As well.
& D9 x# M$ C5 O5 hCCO.Email.SendEmailToIdentity(identity,subject,body,user) 0 w1 t+ v; s; V

% J. z5 A, z" p* k. A% k7 N+ Z4 X8 w
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了