PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

2471

主题

1276

回帖

8万

积分

管理员

PLM之家站长

积分
82195
QQ
发表于 2018-8-1 14:08:15 | 显示全部楼层 |阅读模式

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

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

x
Technique  4 o/ R8 z- U/ H' A' }! l
Use the CCO.Email object to send email messages. , t& g' w% I& q
C#  
2 E1 M# o# p  ?  @% aSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); + ?# [, e6 v0 l2 R- Q
email.From = fromEmail; " `2 D8 F% q) `) e
email.To = toEmail;   |6 T; |9 M5 |0 }5 C; c  P
email.Subject = subject; # ^+ }7 e1 a4 {4 m, |* E4 N% V
email.Body = body; + A( j4 A- X% v1 b6 n9 d
CCO.Email.setup_smtpmail_server_and_send(email);
, _& t, ]* x' A. A/ h' d
/ Y' @( v- Z; b4 i  G1 C- n// Alternatively use the SendEmailToIdentity
# J$ Z) s2 L& y// The first argument is the Identity name to send the email message.
# g. P6 D  r4 I7 Z/ K" p// The second argument is the subject text. 2 R( D' l' u8 [0 a; p9 e9 v
// The third argument is the email body text. 5 Q2 j/ s) `2 `6 u
// The last argument is a user login name as the sender and
8 A0 t, o* C8 x% _* c* A//   if blank will use the logged in user name and
3 A0 V) N  P' S% s4 d# o//   that User Item must have an email address as well. ' V% d0 x6 ~& l* L" G/ `+ E- ]
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
5 {$ I7 I4 s0 d/ Ereturn this.newInnovator().newResult("ok");
$ c' |. r4 h" O0 B- V  VB.Net  4 t0 l! s1 H8 k1 k1 m$ o
Dim email = New System.Web.Mail.MailMessage() 1 x9 Y+ H: Q2 }; I
email.From = fromEmail
( A( B( p! _$ S2 h. m6 ~email.To = toEmail & a$ C- _( l  W* r/ a) i
email.Subject = subject
, e; b2 a0 y7 G/ H; \" Lemail.Body = body
9 t1 y  n1 q& `3 [. v, b  E% xCCO.Email.setup_smtpmail_server_and_send(email) 4 Y2 P% b( U. n* `; E  |
5 H; S/ s  w: N  n6 p
' Alternatively use the SendEmailToIdentity , Z5 P, f1 F7 z4 m8 x1 `9 m% f7 A
' The first argument Is the Identity name To send the email message.
0 q2 y' H3 P/ t* F1 b! R' The second argument Is the subject text. ' R1 u% W9 V3 j+ `: G  t; i
' The third argument Is the email body text.
0 i( C: y' G2 B8 w. U0 E. f' The last argument Is a user login name As the sender And - n4 u3 B5 \% U
'   If blank will use the logged In user name And % J4 S* B) G9 O- ~6 Y  ^7 o
'   that User Item must have an email address As well.
4 F' l/ U) |/ L7 Z2 W6 N! JCCO.Email.SendEmailToIdentity(identity,subject,body,user) & H0 G8 ~( {) }9 A9 @" e0 X( B7 _
5 l  S+ t0 x. y$ E, Z) y  H: R
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了