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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
% ~5 @6 V6 X9 B# Q( FUse the CCO.Email object to send email messages. " o: G, W2 p% @4 K+ n/ {8 s/ p
C#  
$ K( |( W3 |- {; ZSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
3 c  J! ^$ i" Cemail.From = fromEmail;
, i/ c. p* V' ^5 C  Aemail.To = toEmail;   h" c  W, R- m5 W3 E! g
email.Subject = subject;
  C& g" ^) X0 W# Hemail.Body = body; # t2 j3 `8 C8 [$ ~
CCO.Email.setup_smtpmail_server_and_send(email); : T8 I8 k3 j7 N7 B. S$ A

" i7 ]6 B% Q: K0 H2 k6 s// Alternatively use the SendEmailToIdentity
* Y5 I; e$ A' L0 z// The first argument is the Identity name to send the email message.
2 |5 |5 \) q& m8 B// The second argument is the subject text. 8 V1 q& f4 Q; q3 X  Y
// The third argument is the email body text.
0 W) C* E  {1 m: a// The last argument is a user login name as the sender and
4 ]4 g- z6 X8 E1 O+ k* ]//   if blank will use the logged in user name and
7 R0 f8 {) D& w//   that User Item must have an email address as well.
( `, _/ P) K$ C0 `CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
+ m1 N/ B3 t1 y. xreturn this.newInnovator().newResult("ok"); , z' E. v' w, i* T" F) i- E  \
  VB.Net  
. ~4 p- ]$ F6 ?4 g+ k2 h, ^/ |+ m$ ]Dim email = New System.Web.Mail.MailMessage() ( T2 p* W$ R: o/ P
email.From = fromEmail ) |* R, g( ~! U) ~/ f. R
email.To = toEmail * Z  L/ P/ F0 i) |6 j, |" R( J* L
email.Subject = subject
7 B9 `) Z; P/ D. l6 s8 s7 [2 ~/ T  Semail.Body = body
. u& S" _5 ^/ K" C/ J" iCCO.Email.setup_smtpmail_server_and_send(email)
: J( M8 O. q9 W
; L9 w0 d; b# S+ L: E' |, n- `' Alternatively use the SendEmailToIdentity
% n* d% F7 j  k' The first argument Is the Identity name To send the email message.
" a5 g7 v# z. _) n' The second argument Is the subject text. " X  {. s9 t! p$ u" Q+ y) p
' The third argument Is the email body text. 7 R; y  f/ F5 [5 g) Q" W
' The last argument Is a user login name As the sender And # i! x) B, A/ x
'   If blank will use the logged In user name And / P3 |  X8 h, |8 {
'   that User Item must have an email address As well. 0 B$ Y3 p( T0 i/ I  {5 K! H$ J
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
# J0 f$ ~) w* `. X7 ~0 J9 S% g. H% S( X$ W. R4 M2 {
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了