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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  - y! G9 e3 J5 o- D
Use the CCO.Email object to send email messages. & V8 ]9 _1 g( J4 l* L! J! E! I
C#  
" ^/ U" X1 \3 Z- x, W* N3 YSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ! c6 D8 Q9 U/ a2 A
email.From = fromEmail; 0 @6 L9 }" @: p7 z3 E* O
email.To = toEmail; " K9 L  b2 }" h8 h% y9 u% J* k
email.Subject = subject; ) u: {. H2 v! `- t. F& L, m8 l# n
email.Body = body;
0 l% {7 p* K3 t9 i! W' ]CCO.Email.setup_smtpmail_server_and_send(email);
. b0 H3 n# Q4 k1 j1 ^! X % Y& d/ L' m9 |8 {& w
// Alternatively use the SendEmailToIdentity
. d  W1 i2 \% @% y// The first argument is the Identity name to send the email message.
* ?% x- w- t+ r' R// The second argument is the subject text. 9 ]/ [- E$ C( a2 _& F% q
// The third argument is the email body text. 2 E0 ?! V6 t: J, d- X6 _# H
// The last argument is a user login name as the sender and
0 z- ^9 w* V8 ?2 \) s//   if blank will use the logged in user name and , D3 d4 |& q1 T7 N1 Z5 `5 q/ g$ `) d
//   that User Item must have an email address as well. % [& U8 z. b. S  O
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
- m# @2 k& V. W4 {! dreturn this.newInnovator().newResult("ok"); " F6 M" `" ]9 q8 S9 P0 C
  VB.Net  
3 q; ?. U$ ^4 W' [, RDim email = New System.Web.Mail.MailMessage()
5 V( Q7 M: O* q" ~& B( G5 g% |! kemail.From = fromEmail
7 h9 y0 O5 l. Q( {8 R' Y! iemail.To = toEmail
. c0 m5 b& M# wemail.Subject = subject
: L5 B* U& r% q/ @# p6 ]email.Body = body
2 R/ ]% ~2 ]; @7 eCCO.Email.setup_smtpmail_server_and_send(email) + }# C% O8 _4 _5 g; o9 T5 b' M2 [
- j1 C' X! w$ X5 K: V) B- U
' Alternatively use the SendEmailToIdentity
+ d) G7 G( f" |8 c' The first argument Is the Identity name To send the email message. & I7 n5 F! U: C, J/ z4 @1 Y& }
' The second argument Is the subject text.
( A0 f% Q6 g& C' The third argument Is the email body text.
9 c4 B* O2 _9 `' The last argument Is a user login name As the sender And
+ Y6 G1 g7 _% H; F1 K$ f) k'   If blank will use the logged In user name And
& Q9 k8 S3 w- h( m! l- ]* X'   that User Item must have an email address As well.
, k9 X" D; |5 ]# t; D) wCCO.Email.SendEmailToIdentity(identity,subject,body,user) 7 U2 Y+ E7 u+ R+ T+ b- \" `* O, o
* U: m2 U% y- K' d5 _
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了