PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
# F& f' z" J5 t* v0 F: `/ uUse the CCO.Email object to send email messages.
% {1 Q) @3 B* eC#  
- ]4 W+ A8 h- q) X' ^System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
% M6 T; ?6 ?8 p3 u8 xemail.From = fromEmail; ) I7 a. ^, i7 ~' Y5 }$ M- }
email.To = toEmail;
& n+ B! d# {3 Y; @7 b/ kemail.Subject = subject; % b# _4 H8 r" V, v3 J
email.Body = body;
3 B: q% g# X6 Y+ W8 \, _CCO.Email.setup_smtpmail_server_and_send(email);
( f1 o  @* P( U3 _ 3 b8 K6 C2 R# l5 c
// Alternatively use the SendEmailToIdentity
( B6 C" a+ o1 l' _- k! Q0 w// The first argument is the Identity name to send the email message. ) _4 M& B8 ]7 h1 a( W
// The second argument is the subject text.   h, ~1 ^# |6 b& Q- P2 v0 F
// The third argument is the email body text. * M. |8 d/ b: Z" a6 `0 y: _
// The last argument is a user login name as the sender and . P  V, N2 h- }7 }4 u- d$ u
//   if blank will use the logged in user name and
. h  q! M3 g3 \3 k3 w$ K" g# n9 R! ]//   that User Item must have an email address as well.
7 O. B* z. n0 O8 [' E, \* v3 U* OCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
6 q, `! d" f/ [. P0 \- z# M  E$ B4 dreturn this.newInnovator().newResult("ok"); . k; e- P% S0 I$ J
  VB.Net  1 R$ Q& {1 A+ Q' w
Dim email = New System.Web.Mail.MailMessage()   w/ o, m# t% `- I. n, l
email.From = fromEmail
' c# s* C5 M1 F6 o" Jemail.To = toEmail   Q8 q# [! X% E$ Z# }
email.Subject = subject ) i* _; \+ |& D5 u% F* v
email.Body = body 6 o- D( B& `) u* Q1 z
CCO.Email.setup_smtpmail_server_and_send(email) # Z- H4 v9 @. U5 C4 \% v

" e* z, w4 C$ G  y' Alternatively use the SendEmailToIdentity
* ?9 E- y: D+ [8 O  b' The first argument Is the Identity name To send the email message. : ?, `' q$ [& u3 t
' The second argument Is the subject text.
" K( k$ O# E* Y) e8 ?$ R& u( U' The third argument Is the email body text.
2 Q( N, b& M+ w8 B) [1 \6 k' The last argument Is a user login name As the sender And
3 P7 Q  `8 @1 i) u( t; }3 e- d'   If blank will use the logged In user name And
; R6 M! p. W, A; h- u4 o7 j2 E'   that User Item must have an email address As well. # d) P# }* i: F9 [  C; q
CCO.Email.SendEmailToIdentity(identity,subject,body,user) 4 z: f* ?' \/ `- {% y7 Z8 u3 ~. o

$ a& A8 [# o$ \! T/ }; W, T
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了