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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
3 g# T! x& ^/ \Use the CCO.Email object to send email messages. * g0 N' ]* S7 Z1 F3 y
C#  
, }) _+ p/ }2 k7 w9 M/ iSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
( Z: x, A' J3 N4 n4 nemail.From = fromEmail;
$ U7 U4 Z$ \2 Q9 g  F/ G: Wemail.To = toEmail; 2 N* a7 k4 x( g$ z/ l+ O4 G
email.Subject = subject; $ _5 q5 c- R7 n  C2 I
email.Body = body; % D0 s( Y% f  p$ V
CCO.Email.setup_smtpmail_server_and_send(email); $ X; k2 w' m; k0 _$ A0 ^
; c9 T9 d) q6 x7 ?$ E( |7 r
// Alternatively use the SendEmailToIdentity ) R4 O0 \+ @7 U, @$ l
// The first argument is the Identity name to send the email message. # h) W/ X/ ~4 c! I; r) P/ S
// The second argument is the subject text.
/ h; K. d# h3 d// The third argument is the email body text. 4 _) }5 w( w+ _% h3 a8 z
// The last argument is a user login name as the sender and * a* k8 e+ O) n8 ?
//   if blank will use the logged in user name and
1 r5 d/ U, N7 a( Y) n5 O//   that User Item must have an email address as well.
9 w+ `# _1 @: N- ECCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
8 [1 j4 y4 c8 i3 N  A+ Yreturn this.newInnovator().newResult("ok"); & y$ R5 D5 Z/ Z/ i5 B7 L  u  e
  VB.Net  ( O6 L  J' m( Y" l! @- Z8 O5 J& U( g
Dim email = New System.Web.Mail.MailMessage()
5 M: D3 \. ~% o- q; U  D8 iemail.From = fromEmail
4 i" W1 G  y7 C- p1 Lemail.To = toEmail
6 `0 Z) x  v2 }email.Subject = subject # |( a" z1 q* R# J
email.Body = body
+ S/ v' p# @7 Z! _9 h' yCCO.Email.setup_smtpmail_server_and_send(email) ( g, N/ S* ]9 Z$ k$ c6 g

  [2 [* j- {! r7 ^9 {, P: `1 X7 F' Alternatively use the SendEmailToIdentity
* V* I) ?/ D+ o. m6 }" \6 M' The first argument Is the Identity name To send the email message. * |: X* k+ w; Q! K
' The second argument Is the subject text.
6 ?$ K+ F4 A3 @7 ^( ]' The third argument Is the email body text.
8 n, ^) t/ y8 K, A+ x- Y' The last argument Is a user login name As the sender And
3 T  a, K5 c* }'   If blank will use the logged In user name And ; u7 T% d8 R- @4 l, \& I% U
'   that User Item must have an email address As well.
1 r. o; m5 ]4 u- R& J5 [CCO.Email.SendEmailToIdentity(identity,subject,body,user)
( ~5 D8 t& c$ q( t- d! s. v1 L+ L  E# N! M
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了