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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  & [% F  {4 k& Z; Z; ^- |
Use the CCO.Email object to send email messages. 6 [9 ]0 I) r! z
C#  4 v8 z' T/ Q, W8 I5 l3 {
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
3 l4 S0 B, K: h0 semail.From = fromEmail;
" N4 E9 O5 p# c" N6 T% i( Uemail.To = toEmail;
2 L7 H& p, p. N- k+ ]3 Uemail.Subject = subject;
+ @( ~( T5 h0 ]# y. W# K; Zemail.Body = body;
( A1 P; {+ R4 ~8 ]CCO.Email.setup_smtpmail_server_and_send(email); & c* Y6 Z0 x, r( y8 `4 W/ }

' O5 P1 i+ o2 a" l: e* x// Alternatively use the SendEmailToIdentity 6 B: H0 y$ f( H5 D& d
// The first argument is the Identity name to send the email message. ( t* W; J' g8 Z4 [! p
// The second argument is the subject text. 4 z5 P& i* p" _! Q$ F. d. j; i/ j# {
// The third argument is the email body text.
& a2 i& ?) ?2 k/ `6 G1 P// The last argument is a user login name as the sender and $ o" l& P) R( p  t
//   if blank will use the logged in user name and - L1 N8 @! j4 p& z! O- x- n
//   that User Item must have an email address as well.
. X; e; y+ h% Z) C8 X1 A# r9 Q# jCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 9 h& Q2 f- E% u6 d% D& ]  b
return this.newInnovator().newResult("ok");
! [2 q0 X9 X# w  d) n  VB.Net  
1 D% V# c  }9 R1 SDim email = New System.Web.Mail.MailMessage() - L1 a2 c8 v9 v) z# J, e
email.From = fromEmail 7 v* z/ \0 p5 q  }' Y
email.To = toEmail + P+ n  C3 i$ g# R
email.Subject = subject - }% B, w0 W$ e  O
email.Body = body , u! Y2 K1 Z4 `0 f$ b
CCO.Email.setup_smtpmail_server_and_send(email) 6 ?% X6 t0 e" ]+ ^/ g9 e2 C% L
4 u- e! U/ O# N1 b6 ~
' Alternatively use the SendEmailToIdentity $ I9 p% T6 {  d: R# {9 N
' The first argument Is the Identity name To send the email message. . j5 k  Z6 i3 Y' y: T! m
' The second argument Is the subject text. . w/ U/ f0 {4 X+ u, i6 `
' The third argument Is the email body text.
+ T( V9 h& w8 I0 Y$ M0 {5 G' The last argument Is a user login name As the sender And
; _8 z7 }$ h5 ^7 p! F; G8 j'   If blank will use the logged In user name And
) `$ Q/ {( G1 \/ j% O2 ]'   that User Item must have an email address As well. ; K2 X2 l, b% b
CCO.Email.SendEmailToIdentity(identity,subject,body,user) 7 d7 L7 }# G8 X+ n( i
/ V( a8 g4 h1 n3 D$ J
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了