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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  , @) A! R# ?) n8 o& n5 Z
Use the CCO.Email object to send email messages. * D. w9 O. C& L
C#  * ~7 |- ~' X1 E& g% ?
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
  e4 F& o, A8 T' y) V1 pemail.From = fromEmail; 6 h3 w6 M6 A- U& Z. ^: s* p# Y0 E
email.To = toEmail;
& G: ~& j' Q2 S1 \- ~; M8 ?9 z/ lemail.Subject = subject; + R! e( V% V+ C2 ?) N
email.Body = body; ' i( W0 M7 c: F1 \6 `
CCO.Email.setup_smtpmail_server_and_send(email); 4 w' F/ o5 A# T9 O/ s2 [+ Y

! i6 n. }/ c: L/ {// Alternatively use the SendEmailToIdentity
. A6 {5 v% U4 d// The first argument is the Identity name to send the email message.
+ J# a$ q1 u5 L// The second argument is the subject text. * ]/ p1 a! K* e4 h( O/ ~& Q+ c) a
// The third argument is the email body text. , G: H7 K) j6 @4 O
// The last argument is a user login name as the sender and ' H% ]& r7 A* g$ U
//   if blank will use the logged in user name and
% M) S, V( @; i) {/ x8 L3 i! i7 e- w//   that User Item must have an email address as well. : i5 \0 Q9 Z/ G. }- [$ \/ g
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ' A+ d4 `* P! \6 r: }9 t6 z5 H: u
return this.newInnovator().newResult("ok"); / ]3 u0 z0 N2 O9 y, \
  VB.Net  
; t) Z7 h* w5 z- a. n+ @7 GDim email = New System.Web.Mail.MailMessage()
8 F, q3 I  u- ?- s3 aemail.From = fromEmail " C: |9 }% T, o8 W( D* K
email.To = toEmail 8 r, r& P3 d( @4 P
email.Subject = subject
9 |9 A, |6 ]  d/ J& Remail.Body = body / j- Z7 {1 Q/ q  f1 N+ E
CCO.Email.setup_smtpmail_server_and_send(email) 3 h3 x" X5 s8 b

! B) c2 N, ~* S( z- P- J9 M' Alternatively use the SendEmailToIdentity
, n2 M. n+ V" f7 Z' The first argument Is the Identity name To send the email message. 1 K+ \+ i* v. m% ^! v
' The second argument Is the subject text. , |6 L6 J) H/ F5 a
' The third argument Is the email body text. ( p' [  Q; r- F2 V- D4 V
' The last argument Is a user login name As the sender And
9 j, y8 T/ A# P: Q) i3 e8 M'   If blank will use the logged In user name And
: z" B5 v  A6 G8 Q7 E. B'   that User Item must have an email address As well.
8 b! A  z: p: bCCO.Email.SendEmailToIdentity(identity,subject,body,user)
- q* f/ T7 w0 E" e- `0 e0 l, A0 W! ~+ }* P0 v
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了