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

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82168
QQ
发表于 2018-8-1 14:08:15 | 显示全部楼层 |阅读模式

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

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

x
Technique  
; |& X+ i2 ^$ u8 `# oUse the CCO.Email object to send email messages. ( z+ q- D8 T( w( [) i
C#  
& t" w" f3 u$ W6 J0 @. O6 pSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
; E. I+ O$ o, Q5 B4 G' l; Remail.From = fromEmail;
* U: }7 n! n5 J- C/ Eemail.To = toEmail;
3 o/ u1 p4 r0 I7 zemail.Subject = subject;
3 I& f: U) D% Femail.Body = body; . F9 ~7 N* \# j
CCO.Email.setup_smtpmail_server_and_send(email);
; g# r6 a: Y1 J$ u/ x; l" c1 V ) r# J8 ^8 S( C6 P0 I
// Alternatively use the SendEmailToIdentity % R9 g: |) @0 f2 o% C* L
// The first argument is the Identity name to send the email message.
" `" @' T3 F1 y2 m( Z// The second argument is the subject text.   @7 k8 \4 R' A3 e
// The third argument is the email body text.
9 B: `- w0 H/ s+ G; q. p; Y( g/ j// The last argument is a user login name as the sender and
2 K' r5 O8 Z3 H//   if blank will use the logged in user name and 9 D; [8 j) g* W3 z
//   that User Item must have an email address as well. $ y. }4 l2 y( m; S6 C
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
) b1 o% v4 y8 N* K# kreturn this.newInnovator().newResult("ok"); " G* f3 L9 W& G
  VB.Net  7 R* p' R, z1 @# I* E. a$ f
Dim email = New System.Web.Mail.MailMessage() + o. ?; d6 p. L% ?" q
email.From = fromEmail
. ?1 S; t0 f- X, U! l* Remail.To = toEmail - ?9 k3 M4 n# ?1 ]
email.Subject = subject 1 n- s" @6 @3 u& `9 K( w; D% t' y
email.Body = body
6 ]* m9 ~8 S; @/ ]+ }& I5 oCCO.Email.setup_smtpmail_server_and_send(email) 6 `- [+ l# Y4 _/ d( h' Y# V% P- U* s

3 @# m8 \& n/ m9 d' Alternatively use the SendEmailToIdentity ! h; M+ Q: E# T4 _6 r% C
' The first argument Is the Identity name To send the email message. / o* \) {( B( ?# i" E  h1 L
' The second argument Is the subject text.
; i- X1 y# @. b& U' The third argument Is the email body text. ; I$ L* d% k5 C. y# `5 K) z* Y# x) x
' The last argument Is a user login name As the sender And ' O7 I/ S8 I1 G8 q$ a) y' O. Q) n
'   If blank will use the logged In user name And
* s. Z- j7 `5 O) i4 T'   that User Item must have an email address As well. # A/ X; w9 t8 D" m0 c2 _  W
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
1 h( f8 A: ?7 C+ l: d! T; U$ [$ B8 p' e0 w+ K" Q, E
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了