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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
8 c$ t) ^% y+ J/ f) qUse the CCO.Email object to send email messages. ( J# t1 n  L6 R# y$ X7 ?
C#  
7 r" |6 ~, R3 ^5 _5 R; ESystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); 4 C' h7 d3 d& L. a7 f
email.From = fromEmail;
. h9 \1 i( R& semail.To = toEmail; 1 a% b/ f! U: J3 s
email.Subject = subject; 8 C! D" u* B. r4 U" h( N$ Y
email.Body = body; . b) [0 E$ A) o' M) H
CCO.Email.setup_smtpmail_server_and_send(email); 9 @. B5 I& e/ P( E( E0 \2 d' G  `5 w
' H0 v. O2 f3 Q3 i! ~
// Alternatively use the SendEmailToIdentity
8 R! C' Q- h: }  a// The first argument is the Identity name to send the email message.
2 Q" \/ R  {9 H7 H: b( F' l// The second argument is the subject text.
+ H" P: W* G, _. u2 M3 i; b// The third argument is the email body text.
1 B& g# o# A/ |9 Y3 y; H( m: Y7 O// The last argument is a user login name as the sender and
2 @4 i2 l% m* O& [- T0 \: ~//   if blank will use the logged in user name and # j& b) X" T7 a
//   that User Item must have an email address as well. : I" P  U3 L% N; i- p4 c
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
, o! g" f6 R6 E, v7 H' ?8 vreturn this.newInnovator().newResult("ok");
% i( t& p8 @+ l: W3 E$ h, t. n& t  VB.Net  
6 X7 n9 {8 ?0 ODim email = New System.Web.Mail.MailMessage()
( K: I  |) ]. ~2 r  J) S! Qemail.From = fromEmail
+ w* N; h* I) w. P" G: ^+ L: n) ~email.To = toEmail
7 r# _, X( j; f( ?3 F+ t: m$ cemail.Subject = subject . v. d2 C; N* z
email.Body = body 9 a% }/ f6 f7 y. }! }
CCO.Email.setup_smtpmail_server_and_send(email) 2 t& o. I2 a; Y( z( `; i
% e# @9 O+ k, |9 S
' Alternatively use the SendEmailToIdentity
  y5 B9 n+ _0 b0 ]/ k+ o' The first argument Is the Identity name To send the email message.
! z% ~) D: `! [" p' The second argument Is the subject text. 5 J6 B" T5 I; b' I
' The third argument Is the email body text.
& F8 o) b! w0 _. B( D' The last argument Is a user login name As the sender And
. U1 Y- ]* w- ['   If blank will use the logged In user name And & Y# l+ ]$ Y2 j  D( G
'   that User Item must have an email address As well.
6 U6 v5 O9 {/ s% b/ b3 O$ E2 E" s& i( GCCO.Email.SendEmailToIdentity(identity,subject,body,user) & [2 U: N" i: @( k7 d
7 R% X$ c4 w9 q% c( B/ S; B( n
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了