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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
' f/ q: [3 ~" `4 hUse the CCO.Email object to send email messages.   R% t* f- S2 s8 O: f
C#  
2 {( [! H. C( }* J" x! mSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
% B/ G" L, y+ E+ s; K: f0 nemail.From = fromEmail; " S4 O& C& S  M* j  U! S- d7 {6 `6 c
email.To = toEmail; 9 L; A, U% [! }8 G) w
email.Subject = subject; 7 a" v9 L6 _, t, b5 I8 ?% ]
email.Body = body; 3 r! s6 T* x- _/ B! |( O
CCO.Email.setup_smtpmail_server_and_send(email);
. x3 F, E5 O+ Y& y0 O& o/ r
7 r+ `) t2 ^& A5 v9 S// Alternatively use the SendEmailToIdentity
8 j: y) r8 [  }( E// The first argument is the Identity name to send the email message.
: @9 J( ?9 u3 P' A// The second argument is the subject text.
+ }' X- ~* s5 c  n5 g0 g, N& X3 W// The third argument is the email body text. 6 u- i# _9 C! j4 K! ~2 T* |
// The last argument is a user login name as the sender and , ]( B8 g3 v" [7 i
//   if blank will use the logged in user name and
$ D5 {9 v# h  s: C5 r% W( a//   that User Item must have an email address as well.
; n' ~' W; w" d$ [" _: C5 ~CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
' c& v0 u! y* p' Z9 m& m5 zreturn this.newInnovator().newResult("ok"); 5 m9 J4 {5 s4 P7 ?
  VB.Net  & }* P5 k' L! y+ }+ Z* d+ o1 G
Dim email = New System.Web.Mail.MailMessage() - @; m- ^3 o( O# j* l$ Y
email.From = fromEmail
* Y6 b1 }+ P, C  gemail.To = toEmail
+ r" d2 R* r# a7 cemail.Subject = subject
- j9 b7 u# M. ]5 |  M  Aemail.Body = body , B- g- }8 G# |% ~0 m  T9 I' U! K) M
CCO.Email.setup_smtpmail_server_and_send(email) , ]' a4 S: _4 p) z) f
' c  R$ L( z; k: S2 M
' Alternatively use the SendEmailToIdentity + h6 `3 O0 r; g
' The first argument Is the Identity name To send the email message.
' R$ t$ p9 ~6 K! z+ s& a# d' The second argument Is the subject text.
2 p  p, J3 O- w5 N* x" U% i( ?' The third argument Is the email body text.
' g: l$ N7 e8 z+ f: @+ x% \' The last argument Is a user login name As the sender And
" X- i1 l: ~" j3 N) J% O'   If blank will use the logged In user name And 4 J. b# t  D# t
'   that User Item must have an email address As well. 9 _! U+ w- G" r2 }; L4 B
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
& s  J  i/ T) S, n+ |7 Q1 ]8 L
1 v5 D! r+ B5 p: z% c+ N0 t
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了