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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
( _# @/ _/ p8 b' ?: A; ~Use the CCO.Email object to send email messages. ( x. q; H; U% d! M% [
C#  0 n  L" c; C+ J4 N6 C
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
' K' v4 p' g/ \; {2 s: G& jemail.From = fromEmail;
/ i! o2 [3 `. M6 N" e5 |5 pemail.To = toEmail; 4 W8 K' F( r1 ^1 f% Z! C
email.Subject = subject; 9 ?8 z+ u% y1 z9 m/ R5 P  C; X
email.Body = body; # [( O0 U2 `- Q; t+ Q- |
CCO.Email.setup_smtpmail_server_and_send(email);
$ X  v0 h( @- c1 t+ A# M
8 f% i9 X; h) L9 @// Alternatively use the SendEmailToIdentity 3 u1 ], c2 ^  _1 }1 G$ P: A
// The first argument is the Identity name to send the email message.
: T' _% [1 ?2 `3 H2 b- `. V& ]% V// The second argument is the subject text.
+ R7 S- V5 o% M3 T( y3 U: ^// The third argument is the email body text.
0 f. Q2 s( d% P! g' R, d// The last argument is a user login name as the sender and 7 e" L5 s- X& X* ~& X2 M
//   if blank will use the logged in user name and ( ?7 p4 a" n3 c$ ^& R: N
//   that User Item must have an email address as well. ! Q9 z8 ]9 s. n6 f' r5 D) P
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
% t0 e0 U! i& zreturn this.newInnovator().newResult("ok"); ! H! q5 ^5 ?  X
  VB.Net  
5 C0 \  Z2 U/ T, i# V% D8 A+ vDim email = New System.Web.Mail.MailMessage()
9 n8 y) u" u  F+ `& C8 `; \email.From = fromEmail % p+ I& Y' G7 u( ]9 l' g
email.To = toEmail
5 y$ a: V  r8 w5 o6 F& E8 Z$ Q1 Semail.Subject = subject
1 n7 \6 X7 t, [* t% Y# Memail.Body = body + K) \. \4 A. r8 K, i
CCO.Email.setup_smtpmail_server_and_send(email) / K  n$ g# O8 e$ G& b) p

2 [  B% K; O' {8 t7 ^9 R( p( Z" H; P' Alternatively use the SendEmailToIdentity
( P9 k' p' x& P. P% a# z3 Y' The first argument Is the Identity name To send the email message.
) f, n$ Q$ L$ W, `( c: `7 w' The second argument Is the subject text. . M2 J7 n: O* g/ I1 R1 k
' The third argument Is the email body text.
% q; D/ D# s5 T* ?$ _, q+ A' The last argument Is a user login name As the sender And
8 E0 {3 t, d/ T- ^'   If blank will use the logged In user name And
( F) I. S: r& h4 |& W0 n) c; c& Z'   that User Item must have an email address As well.
8 b8 ^+ ?; ?# }  |9 vCCO.Email.SendEmailToIdentity(identity,subject,body,user) ; h2 k1 c  Q4 b1 Y$ C: `
0 w- O7 i7 H* a8 u% ~1 U
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了