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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  7 n. T" i% [% D% p: P" D
Use the CCO.Email object to send email messages. % E% o( |$ a- u, F8 c" k
C#  
; U. \: I+ W# |. MSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); # }7 O8 w' V5 P. h; F! F- l
email.From = fromEmail; 8 V+ Z" W7 o$ @3 w
email.To = toEmail;
1 m* ?/ Y( g7 Gemail.Subject = subject; 5 _' b+ H7 Q/ W$ h8 p
email.Body = body; 2 F# u; v( P) V) n3 I/ k
CCO.Email.setup_smtpmail_server_and_send(email);
$ g2 m$ k; {: S . T. A" s) i' M5 E0 Z
// Alternatively use the SendEmailToIdentity
" E5 b! u2 [: r* e4 g// The first argument is the Identity name to send the email message. ) E( ]; @& n7 W* c' a* G# ~
// The second argument is the subject text.
& K7 h4 `( ]4 z// The third argument is the email body text.
* @" k7 y$ W* L// The last argument is a user login name as the sender and ) u3 `3 U2 X4 b0 O- j& n
//   if blank will use the logged in user name and ( {) E# x' K/ a9 C- P, K5 Y) E& G
//   that User Item must have an email address as well. 9 N$ l' q3 y" t( w& y/ M
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
0 w/ u& [: t# v- Yreturn this.newInnovator().newResult("ok"); ! ?0 O2 c4 z# P( S
  VB.Net  , y8 R4 M) }7 k! S
Dim email = New System.Web.Mail.MailMessage()
6 L. v) X, Y" v% V- {- Temail.From = fromEmail * E' v) v! @- ~
email.To = toEmail ) {2 e. C  i. J/ ^; Y& T4 B
email.Subject = subject
) J6 i6 B- |) T# Cemail.Body = body / ^/ j/ X) G; b4 \- z
CCO.Email.setup_smtpmail_server_and_send(email) 6 U) I8 u8 o9 T4 T+ p+ U7 |

2 Q* Y1 G" Y9 |' Alternatively use the SendEmailToIdentity
$ |( w9 a- A' ~4 e. K, d' The first argument Is the Identity name To send the email message.   a+ h' ~) K# u; T, X& `
' The second argument Is the subject text. 2 }$ D. O: g: _$ j
' The third argument Is the email body text.
" C* w5 q/ C$ f! J; R' The last argument Is a user login name As the sender And
3 J: K% ^5 b3 X. D'   If blank will use the logged In user name And . L# u, F# t" l% ?: j% m& D
'   that User Item must have an email address As well.
; ~% ?! z- R( Y1 cCCO.Email.SendEmailToIdentity(identity,subject,body,user) : e7 E1 ?& ?6 l& V- V$ \+ ]
; K+ d" m% L, [- F0 F3 n0 d& k
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了