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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
4 }( n' @: Z. HUse the CCO.Email object to send email messages.
8 g. [8 N7 `9 V! }C#  3 s( g# Y! u5 Q
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& v0 c$ t" F6 v, H- j' `email.From = fromEmail; / T' t: M* H/ h+ J) ~" I) }
email.To = toEmail; / n: k/ D+ {" m. m
email.Subject = subject;
9 R4 x1 R+ z' X& M' G' ~email.Body = body; 1 p8 e  L# k+ W  \6 O0 ]
CCO.Email.setup_smtpmail_server_and_send(email);
3 G% Y. W; M9 N* t6 E6 Q% M
% N/ S  M) h6 O$ i3 V6 T& _" O// Alternatively use the SendEmailToIdentity ( Z. x8 u: u4 y+ ]2 [4 L# `
// The first argument is the Identity name to send the email message. 6 A) D  y* C  |
// The second argument is the subject text.
9 S' j! p% z$ {& [* c* h// The third argument is the email body text.
4 q% i" ]) l; z4 x+ F7 N7 A; N; Y, N// The last argument is a user login name as the sender and 8 x7 ~4 y8 i' H# u; h: L
//   if blank will use the logged in user name and 9 V2 L; t$ o" C( j6 D9 m, f" [
//   that User Item must have an email address as well.
0 r5 w) E1 j  _7 ]" nCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
4 n* U% U: M+ J) q; g$ Y4 X8 Hreturn this.newInnovator().newResult("ok");
8 A7 K& X; T9 m' x4 W( ?  VB.Net  & z0 }: _7 T% e. e9 b, D: D. Z
Dim email = New System.Web.Mail.MailMessage() " p3 ?0 v' s" P5 F0 T! |) E
email.From = fromEmail 3 h2 k% M9 g7 w, u3 {- ^$ [" D
email.To = toEmail 7 v4 m1 G& i4 W" W
email.Subject = subject
# R* V+ r- N9 A- a/ wemail.Body = body
. l3 k$ m* ~" U  ~% Z' H  xCCO.Email.setup_smtpmail_server_and_send(email) ( y( q" `. ?5 r0 `' Z. ]4 X' \

) m; e1 ?% |, ~3 @1 u' Alternatively use the SendEmailToIdentity
- i8 F. k8 Q: V; c' The first argument Is the Identity name To send the email message.
4 j4 g8 _1 C# n! |+ |/ a' S6 B' The second argument Is the subject text. 3 t* {$ d  I! p3 O% {3 H% B
' The third argument Is the email body text. + _2 U/ g- V- c8 z. }& t3 W
' The last argument Is a user login name As the sender And
0 H5 T7 [. l8 h$ L7 {! M! U'   If blank will use the logged In user name And ' ^, w* E% e* a" ~. E/ f
'   that User Item must have an email address As well.
+ j8 x& _1 v7 e! CCCO.Email.SendEmailToIdentity(identity,subject,body,user) + |% T  O9 H9 e$ K0 C

/ h* T3 d  m3 ]% o0 i* F" I+ }6 q" q
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了