PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82172
QQ
发表于 2018-8-1 14:08:15 | 显示全部楼层 |阅读模式

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

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

x
Technique  6 {7 f1 G5 K- Q4 |
Use the CCO.Email object to send email messages. # u5 |& \$ U" x' P
C#  
' H& u* p: t7 x5 X3 NSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); $ {- v$ ^/ b1 k$ g6 h7 n4 q3 T# A
email.From = fromEmail; ! r. E5 d7 _" @; D' k
email.To = toEmail; * l6 n6 c' X( X6 Q* `% |
email.Subject = subject; & |; ~$ C/ Q( M! e# H7 G! h# ?1 T
email.Body = body; % }" t" p- D: F; p
CCO.Email.setup_smtpmail_server_and_send(email);
+ n0 \7 P' x, q( V0 ]* @; c , w9 v1 O2 q2 K  T+ C
// Alternatively use the SendEmailToIdentity
5 Z; E/ A" R' K// The first argument is the Identity name to send the email message.
" [% Y! `4 @$ s2 P6 p// The second argument is the subject text. $ M! _: M0 |- y
// The third argument is the email body text. 0 \5 o8 h7 h3 F. j) X% G
// The last argument is a user login name as the sender and
& p3 I0 j- @$ C) x1 ^: p! p//   if blank will use the logged in user name and
. i% q0 P3 X: W( K% v. [//   that User Item must have an email address as well.
7 z! H# y  \! M- x& Y0 {CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); & R7 m2 g" K' m( L. U: [6 K
return this.newInnovator().newResult("ok"); ! w. x6 Y! s/ F& d9 }0 N* L
  VB.Net  
" U3 i0 U9 ^+ kDim email = New System.Web.Mail.MailMessage() 8 |' |8 y* }% \% t% L, ^
email.From = fromEmail & ^. ?! F! k# p2 W$ ^
email.To = toEmail * F" I) h' ^4 b9 C& P
email.Subject = subject
/ c! c4 s: p  A9 |5 h. n% w2 Q' [email.Body = body ; `& x1 B) r& ~; C  P, @
CCO.Email.setup_smtpmail_server_and_send(email)
; X" a8 Q% L; m+ J0 k7 S6 d
% a  v% y/ s9 L$ Q2 }! T' Alternatively use the SendEmailToIdentity
* T$ m. c. Y) C) z! f2 G' The first argument Is the Identity name To send the email message.
9 O/ k0 l, Y5 H' a$ Z' The second argument Is the subject text. 2 l" n) O2 Q2 {* Y# _' R$ j, Z* d6 w
' The third argument Is the email body text. " ?. F  S0 D% `
' The last argument Is a user login name As the sender And # U1 C- N% P$ [2 d! h! ~
'   If blank will use the logged In user name And
1 B/ r# t0 h  G'   that User Item must have an email address As well.
+ Q  F; z! ^+ }  v, z5 lCCO.Email.SendEmailToIdentity(identity,subject,body,user) - h4 k' X3 c7 ^0 a' k( f& a7 K8 N
6 `& J2 N& ?! @6 ~8 u0 R  ^
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了