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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
! N2 O8 i: w" n4 sUse the CCO.Email object to send email messages. ; l  @3 K9 |( f6 n. y/ B: x
C#  : t6 R! ~. o3 w7 p
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); / K, B( v' N8 y, s
email.From = fromEmail;
' K+ C+ G5 q( X6 q" J2 M9 Eemail.To = toEmail; . d" G  i2 A6 W& H. W$ X
email.Subject = subject; 5 z: V/ x/ q$ w. w' r
email.Body = body;
0 u0 D' n& C2 Q8 tCCO.Email.setup_smtpmail_server_and_send(email);
  G; l/ S2 c9 s% p4 R $ n) l0 P; _4 ?
// Alternatively use the SendEmailToIdentity
/ [' q  f% F! n, `* x4 v0 s// The first argument is the Identity name to send the email message. 7 L/ {& x! N7 N: l5 z: [8 P
// The second argument is the subject text. + r3 Y, x" a* ~3 K
// The third argument is the email body text. ) t  Y; \$ a( t  Z* q4 _' h" D
// The last argument is a user login name as the sender and . Q: C9 z' G4 v
//   if blank will use the logged in user name and
  ]) z$ ?0 F: C2 b//   that User Item must have an email address as well. * f$ W, H* ?* v
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
. ]) K! V* O7 W7 f0 B% _  I% jreturn this.newInnovator().newResult("ok"); 7 M  w0 I# ^) v% }# L" a
  VB.Net  6 V6 {' `  R% ?: K
Dim email = New System.Web.Mail.MailMessage() 0 o: }& x8 j& r6 Q- x: L1 c
email.From = fromEmail 9 S& r1 n/ \$ `" n
email.To = toEmail $ ^: l3 Y" p1 e# L4 S" k/ O6 A; I
email.Subject = subject
+ L* ^6 G3 d( Wemail.Body = body
) t$ @' Z, K& F3 T( gCCO.Email.setup_smtpmail_server_and_send(email) + y9 W& W! N, A7 p& ]5 f' Y
: @. P( |; s  K4 |- F5 `$ v* N
' Alternatively use the SendEmailToIdentity % D% a4 K# \) c" N$ K
' The first argument Is the Identity name To send the email message. 8 m/ w% v. H& o) J7 s
' The second argument Is the subject text.
0 N6 j% {; Y- j9 r- a+ ]/ H' The third argument Is the email body text.
9 f  L8 z( P% q0 r) Q# F$ t' The last argument Is a user login name As the sender And 6 M; D! k" X# S2 f" ^
'   If blank will use the logged In user name And & t+ x5 M- ?2 A1 ~8 J* w
'   that User Item must have an email address As well.
0 ^1 c" r* ^0 F; y& uCCO.Email.SendEmailToIdentity(identity,subject,body,user) 1 d4 Z/ w/ v' B! e6 A

% g; @, g2 J$ c
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了