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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
. U7 K8 N% m7 o; ?Use the CCO.Email object to send email messages.
7 L" P; A: Y2 E) {$ IC#  
$ v1 C- L, }* |$ \6 tSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ! N4 o5 L8 y1 H5 J
email.From = fromEmail;
6 t9 }# P% G0 I1 k$ a; X1 |3 O7 qemail.To = toEmail; . s$ d; B4 M# }* w4 r; @
email.Subject = subject; 0 ]% J  C+ K: G- O7 a4 o) z: j
email.Body = body; # Z5 u, M$ ?& |
CCO.Email.setup_smtpmail_server_and_send(email);
6 r7 [1 S/ k0 I: F3 B* U" A% k ! R% [2 t1 [/ m/ Y: V
// Alternatively use the SendEmailToIdentity
7 G- H) ?. ^' T. N7 ^! |- l// The first argument is the Identity name to send the email message. % {# V5 Q. [! R* i) w6 h% k/ `4 W9 S
// The second argument is the subject text. ; K- d$ E% j# n4 i, X  y4 V' g
// The third argument is the email body text. " X/ q/ v& X; t& T$ k4 T4 J
// The last argument is a user login name as the sender and   b; I, A1 G1 a% H
//   if blank will use the logged in user name and
  T3 l! S. f. }* l) B- m//   that User Item must have an email address as well. 0 f' g: S8 M2 O; g. h; ~( r
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
: C& p) Q# w  u8 M: Lreturn this.newInnovator().newResult("ok");
7 l7 w1 C$ g6 \# o  VB.Net  7 p  {7 [4 N- L' E6 L1 Q
Dim email = New System.Web.Mail.MailMessage() 6 Z( N9 ~4 D& k
email.From = fromEmail * ?) l0 \( G& J
email.To = toEmail
, a0 k8 y. e3 ^2 |email.Subject = subject
/ V9 I) A' _) L1 K+ eemail.Body = body
" ~3 z4 m4 a. |; k, j" P; O; Y  {6 XCCO.Email.setup_smtpmail_server_and_send(email)
0 J8 M- G9 \! d( c7 Z
" O$ Q6 f# T3 o4 O# @; a+ ^' Alternatively use the SendEmailToIdentity & I8 q8 w: Q5 n: Z/ H2 @
' The first argument Is the Identity name To send the email message.
7 x9 L! r) j2 v' The second argument Is the subject text. 1 P- A: L. \+ Y& _; Q
' The third argument Is the email body text.
4 B/ {; o2 w1 L' c" w5 a' The last argument Is a user login name As the sender And & a! f, S6 M" Y/ s! i1 |' r
'   If blank will use the logged In user name And
: U9 S' T7 U; x" N6 v0 k'   that User Item must have an email address As well.
* e3 c- z) ~  D4 ^* i# r9 ACCO.Email.SendEmailToIdentity(identity,subject,body,user)
) }- p3 _& A! z. N1 T7 t
5 w4 d) [& N- Q; U  D8 j
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了