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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  6 J' a% V/ K9 t5 `: q
Use the CCO.Email object to send email messages. - ]6 R3 O$ b1 m+ p
C#  
3 P9 f' m( W8 I7 ~9 D6 hSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
, v! d. ~( X  g7 X4 j- Uemail.From = fromEmail;
; n! Y: s  ?7 ?" l; `# p$ \email.To = toEmail;
+ C# I8 D4 d8 t+ l9 u' v- Z+ hemail.Subject = subject;
3 M; g4 K/ @0 w9 _* ]email.Body = body;
# h, Y6 e2 o3 Z( CCCO.Email.setup_smtpmail_server_and_send(email); ! D3 W. k0 y7 ^3 h/ Y

9 g  u4 U1 e6 m' b( M// Alternatively use the SendEmailToIdentity
/ e1 A( O0 P7 V, }. W+ g! X// The first argument is the Identity name to send the email message.
' {* l, x* `# d7 k& v$ ^// The second argument is the subject text.
% S% j+ ]& s4 u4 x) j' R: F// The third argument is the email body text.
6 W( p+ e/ I# b- f8 o// The last argument is a user login name as the sender and $ l$ |  A$ {% p! f; ~
//   if blank will use the logged in user name and + a$ a/ W) o9 w: o7 }
//   that User Item must have an email address as well. 3 \, M3 x% i! {2 ]8 X' X0 V$ Y
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
/ C$ c- N) ~# @8 M( F! b$ `1 creturn this.newInnovator().newResult("ok"); ( b5 I3 b5 ~% E
  VB.Net  
1 o# ^( B  J  i& I/ @. m6 V" ]2 f% ?Dim email = New System.Web.Mail.MailMessage()
) J9 `# |' l, B* Bemail.From = fromEmail ' h( R; a7 _! Q& O9 s: I
email.To = toEmail
; o. D6 ~) G5 R/ {* P: a! jemail.Subject = subject . |; I) \/ Z8 b3 c% v$ ~+ h  m& M1 ]
email.Body = body
$ ^  }/ o' x$ J0 C% BCCO.Email.setup_smtpmail_server_and_send(email) ! P" [, o5 V' {7 u; T% G

, R1 c1 Q7 a1 ~$ C9 [' Alternatively use the SendEmailToIdentity
; h- X; x$ Y: K' Q/ l8 i7 W' The first argument Is the Identity name To send the email message.
2 C; b; h: d' ^. r2 G$ G' The second argument Is the subject text.
  {7 D) w& p  d' The third argument Is the email body text. ( X& l/ n& I# D3 V2 Q. V7 t6 L5 M. Y) n
' The last argument Is a user login name As the sender And 1 ~. B: v, \# B( T# |( [6 K# P! [) }
'   If blank will use the logged In user name And
7 {1 S' V. ?& l# K'   that User Item must have an email address As well.
: R  a9 \2 S, v- \$ v0 OCCO.Email.SendEmailToIdentity(identity,subject,body,user)
* g2 c; k2 L5 j% L- r3 |- {
0 A$ I  D/ q' O8 q. y3 g, q4 B/ R; X
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了