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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
/ y% a3 u4 J. V3 Y% ?Use the CCO.Email object to send email messages.   h. A/ Y! |: n% b& y/ C: _
C#  % r* t+ h# h1 u- C" U- ^- l
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ' l$ B' P  t$ u* D2 @7 X6 E5 |
email.From = fromEmail;
4 Z5 N  w) J. E" z1 N2 I4 eemail.To = toEmail; 1 T* I' C/ J/ X
email.Subject = subject;
: A8 h% \9 p6 ^% L% xemail.Body = body;   P3 l. k' f) W! J  \: X
CCO.Email.setup_smtpmail_server_and_send(email);
5 B2 s& a) y3 F! w
2 }6 J# a- B/ ]8 f& X$ ]// Alternatively use the SendEmailToIdentity
9 n8 q, ]; ~' e; A: E1 l1 v// The first argument is the Identity name to send the email message.
* V1 y% l+ p6 b1 n0 {+ d// The second argument is the subject text.
' k1 ]' V0 [, q// The third argument is the email body text.
. w# N) V0 @5 W4 W% S" |// The last argument is a user login name as the sender and . O* }8 Q% I6 X; \, g7 r
//   if blank will use the logged in user name and
* G' Q0 F! J: I# Q8 D. P//   that User Item must have an email address as well.
, q( H3 y, C& @( T" f/ jCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ! i, Q3 F/ b# E% Q1 _- r
return this.newInnovator().newResult("ok");
8 u) t" e$ m8 Y! u9 C; L  VB.Net  
! ]6 z# w( J0 ?5 w9 a; F" WDim email = New System.Web.Mail.MailMessage()
& ^9 i! V$ F$ @4 Xemail.From = fromEmail
3 D* ~, r' ?( H) _2 A6 ]+ W4 ]email.To = toEmail
1 T2 \; Z& r- B. uemail.Subject = subject " _8 Y/ z, Z! E) m" N; x$ A
email.Body = body
( S% ?/ W% K3 s9 ]CCO.Email.setup_smtpmail_server_and_send(email) - M0 s" ~: R% o7 |4 g
3 |( x$ B6 ?& y" H
' Alternatively use the SendEmailToIdentity
9 Y) |( Q0 _2 u6 R1 A9 Z% c' The first argument Is the Identity name To send the email message. ) O& v: F( W/ q
' The second argument Is the subject text. # f6 q2 E+ u: |) N0 ~
' The third argument Is the email body text.
5 T$ d( w4 I3 ^, K7 F, A' The last argument Is a user login name As the sender And
, J! e& o% p' F% f'   If blank will use the logged In user name And 5 Q6 ]$ K* p" D$ d' U
'   that User Item must have an email address As well.
1 Q- {6 I- E4 a) o0 \* OCCO.Email.SendEmailToIdentity(identity,subject,body,user)
7 d% c$ X; m+ u( Z8 p7 o$ v- I# C2 `
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了