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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  + H" C8 g2 _" v" J+ g
Use the CCO.Email object to send email messages.
6 T/ C5 E: a: E- g" [: R) cC#  
' u5 h; d+ U9 i% M, [3 bSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
  ^, V' z+ [. w' ]email.From = fromEmail; 2 b& p# @5 s. ]) z5 ]( i$ I. \
email.To = toEmail;
0 M: h" X2 E7 X/ Femail.Subject = subject; / T% ~) C) c5 ~* P  b3 X
email.Body = body; 7 @2 t$ F& u2 ?
CCO.Email.setup_smtpmail_server_and_send(email); 2 I/ Y9 I8 ~: k+ C3 h- X! |7 w- Y- ?

. `# T' D- `4 Z5 W9 y6 @// Alternatively use the SendEmailToIdentity 7 n, F) J4 O7 n
// The first argument is the Identity name to send the email message. / z5 X! Y; S9 H! l9 W2 j. [5 ]  k6 Q
// The second argument is the subject text.
6 `& w6 _" {( \; z5 E// The third argument is the email body text.
$ m) x% m; A7 q% e2 `* _// The last argument is a user login name as the sender and
* a1 R8 Q. u. Z1 W( `//   if blank will use the logged in user name and
" R+ x. V5 h2 l/ ^//   that User Item must have an email address as well.   U/ c5 X+ W+ y
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
! G/ C" D0 j8 A2 ]9 [return this.newInnovator().newResult("ok"); ' M  c6 S' z. n5 K- G
  VB.Net  * c: Q  B8 }7 o: ~+ J( E# _$ u
Dim email = New System.Web.Mail.MailMessage() / C0 R5 D) k) g$ q2 O
email.From = fromEmail
1 K! A# F& g+ Memail.To = toEmail
" w, e- G& M. E8 z$ h$ Vemail.Subject = subject ) m8 W3 G: r- O+ \& n- m' O' R
email.Body = body
) Q+ a  ]; t- |4 A0 K  wCCO.Email.setup_smtpmail_server_and_send(email) ! l7 P# g7 U) r# R
6 {! Y2 z/ Z: F- y$ w
' Alternatively use the SendEmailToIdentity
: W+ R1 l. O( y8 x' The first argument Is the Identity name To send the email message. 9 A: b  t) O0 g8 n4 M) C3 B
' The second argument Is the subject text.
3 t+ M) q6 m1 a2 p1 m# z. s' The third argument Is the email body text. % J. o! k( ^! Y! ]; `/ Q. W
' The last argument Is a user login name As the sender And
3 L4 B. D/ P% S4 a; ]1 ]0 r3 {1 l! |'   If blank will use the logged In user name And
9 y/ _0 m# \) ]- c'   that User Item must have an email address As well.
2 c% s2 s1 U7 d6 U% L8 |CCO.Email.SendEmailToIdentity(identity,subject,body,user)
  w; s  j5 I, a0 Z; G4 e- U$ Y4 L+ U+ q' N; A
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了