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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
: u. `  o+ G! L2 E# ^! oUse the CCO.Email object to send email messages. 5 x/ w4 {- A# }8 l. @+ L
C#  1 X5 |' i  {8 P/ D
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ' f8 t3 }" o4 H9 i5 Z0 N
email.From = fromEmail; 7 N& @2 {+ Y; V4 c/ @% y) |' b
email.To = toEmail; $ N5 H0 S% J( ~9 y
email.Subject = subject; & P0 f5 B$ ^+ W, ?$ K8 N' p
email.Body = body;
; @$ ^& f$ _$ Y, u4 k5 uCCO.Email.setup_smtpmail_server_and_send(email);
  y. N5 ?( r% G6 @
% G! [8 i/ T1 c// Alternatively use the SendEmailToIdentity
& V' [$ F2 N/ G/ x6 P  `! Y// The first argument is the Identity name to send the email message.
- S! `( q) w  X. s' ~& d( G// The second argument is the subject text.
+ L2 U$ @6 S4 j2 i9 z// The third argument is the email body text.
! U. B1 V( M. e: o// The last argument is a user login name as the sender and 7 ]  c3 f" L9 c: J/ {" S
//   if blank will use the logged in user name and : v8 X# W2 B7 O7 o
//   that User Item must have an email address as well. : f6 P5 T+ V" d+ y
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); * f& P1 P/ S: S  Y0 P/ b
return this.newInnovator().newResult("ok");
4 ~% x7 n5 {* l/ {8 k9 z  VB.Net  
' t6 u5 X& b! Z3 Z. s. [Dim email = New System.Web.Mail.MailMessage() 4 |& @# {3 I" S  x6 F5 I
email.From = fromEmail - e1 o+ Y; O1 b
email.To = toEmail 3 }& @4 k% H' x+ h% ~' V+ h
email.Subject = subject
: V8 L' x( _  e; V, d- iemail.Body = body   q1 L+ q) f6 J
CCO.Email.setup_smtpmail_server_and_send(email) 3 K+ H+ Y4 p7 S" c" E  _
8 d+ t7 t* B- h# W6 G5 y5 e: h
' Alternatively use the SendEmailToIdentity
! [" b! s0 ^; y' The first argument Is the Identity name To send the email message.
4 v" m$ H* P0 y$ C! ?4 f) g. U' The second argument Is the subject text. & ?; ]$ R. l3 ^
' The third argument Is the email body text.   X& ]( c; H* t- n
' The last argument Is a user login name As the sender And
" w% {, u1 K1 o+ \7 |2 T% U'   If blank will use the logged In user name And
$ _/ T3 l; b4 Y/ u'   that User Item must have an email address As well. 3 X4 D+ j- |7 j
CCO.Email.SendEmailToIdentity(identity,subject,body,user) " N+ K3 I0 O& p* y, {* l
, P* Y2 ?1 L- d8 Q
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了