PLM之家PLMHome-国产软件践行者

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  1 u, M7 A! ]/ J5 D
Use the CCO.Email object to send email messages.
  g4 d: \- ]: Q) H* ^$ P& PC#  / Z- _+ u6 k  {6 [
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 8 a6 l$ g2 w% J& W, |  ]6 A- L/ {* R7 ^
email.From = fromEmail;
: F4 v' c9 v: _) R  |email.To = toEmail; 1 i. @& x, n0 n4 \% \1 K
email.Subject = subject; 0 O% b9 ?7 x" q& A# A6 |6 C# \
email.Body = body; * g7 ], @( d+ v! F. G' M+ p
CCO.Email.setup_smtpmail_server_and_send(email);
+ Y& f' r( y: D; V% }, I4 l4 ~5 D
0 {  {- O4 C& x7 w2 r  y- a// Alternatively use the SendEmailToIdentity
+ v& C9 A# W9 L" W" C// The first argument is the Identity name to send the email message. / v, v- Y" U4 F( n# F" }2 Z
// The second argument is the subject text.
/ ?8 {- h4 I3 D9 ^) I, e0 ~1 x// The third argument is the email body text.
" C' ^. ~* M; u// The last argument is a user login name as the sender and
$ H4 {4 |$ n' H6 \1 G//   if blank will use the logged in user name and $ \( I/ z+ j+ p6 E3 v3 @
//   that User Item must have an email address as well.
7 w# B: y. B2 _7 F6 D3 \- y+ hCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 5 y% X6 M: L# U/ w1 o6 ?: Z
return this.newInnovator().newResult("ok");
# g6 l" O7 M. S& r/ r1 M* [  VB.Net  
8 r3 x" d/ B  V; z4 ZDim email = New System.Web.Mail.MailMessage()
5 J) `) w7 m: @  f6 [, F4 i4 zemail.From = fromEmail
) b4 i& _) n2 Iemail.To = toEmail
( c1 |3 Y- A8 c, \1 i! |1 Femail.Subject = subject
6 N; Q, s) T; Vemail.Body = body
/ h( ^8 E8 G% @0 NCCO.Email.setup_smtpmail_server_and_send(email) 4 Y1 K0 g  K1 f2 O

/ ?- L( q7 p: J  P9 C' Alternatively use the SendEmailToIdentity
  U* H2 V4 }' r" |4 _. ^' The first argument Is the Identity name To send the email message.
1 v* q6 p7 y" s: o7 N' The second argument Is the subject text.
+ B' ~" F3 b5 y0 s' The third argument Is the email body text. / ^5 `. p( \: N! |( l3 c. w7 k
' The last argument Is a user login name As the sender And
+ N3 R5 u% w- B" ^'   If blank will use the logged In user name And 3 e2 O2 n1 Y8 s# W, B
'   that User Item must have an email address As well. ; N+ a& y/ ~$ O3 n! u- X  e
CCO.Email.SendEmailToIdentity(identity,subject,body,user) % `: }( O& w4 w$ ^

% V! ^* f# \/ V/ o2 Y
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了