查看: 3960|回复: 0

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

[复制链接]

4

主题

3

回帖

40

积分

管理员

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

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

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

×
Technique  : F; \8 B, o. C. `9 S: A7 k
Use the CCO.Email object to send email messages. 4 d7 g5 X  o% R
C#    _& z* J) M. ~8 {2 a2 K. Y
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
, Z) c4 a5 }/ e( q8 kemail.From = fromEmail;
. S- X& [' t+ R& ~3 H7 [- Femail.To = toEmail; 1 I, f; h4 k' ]
email.Subject = subject; 6 X' @0 y# z6 E
email.Body = body; ( |7 X7 n# r& u
CCO.Email.setup_smtpmail_server_and_send(email); & E8 G' U8 ]8 Q! }7 l7 N

1 i& U. B7 H5 h$ a$ x// Alternatively use the SendEmailToIdentity   }4 p2 C; ?5 l& s) L
// The first argument is the Identity name to send the email message.
1 B1 P  a1 V8 m! b1 ?' u: T// The second argument is the subject text. / Q* m) V5 _: v" |( \
// The third argument is the email body text. ) z+ ^4 y  O* n; ^  G' X
// The last argument is a user login name as the sender and
5 y( Y# n% b& B4 q+ n7 W# X0 I//   if blank will use the logged in user name and , z! n8 @9 E" o$ D! E
//   that User Item must have an email address as well. ' r$ P, V- J$ O% P
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
+ A: }# G$ W$ \1 b- G" ^) C9 e. Preturn this.newInnovator().newResult("ok"); 3 m9 \4 ?) g0 c& S
  VB.Net  3 H5 h1 O. ?7 S" |9 y4 P
Dim email = New System.Web.Mail.MailMessage() ! S1 _% ]) s% V
email.From = fromEmail   {$ f: q& \3 o/ L2 t# w- Z
email.To = toEmail
2 N. T; ^! E7 ?" _4 Pemail.Subject = subject ) o9 Z0 x6 ~, Q6 E) P: z" \
email.Body = body # l# ?9 L6 ?! d. V8 s6 _
CCO.Email.setup_smtpmail_server_and_send(email) ' q/ m. o7 H- ?* t, p$ K

% E+ P/ ^4 [9 u9 s' Alternatively use the SendEmailToIdentity
1 a9 q& T$ \' W" j$ P' The first argument Is the Identity name To send the email message. - \/ S8 A2 h: d4 R" a" k: |
' The second argument Is the subject text.
. o$ ^( `0 U+ a' The third argument Is the email body text. . `5 ?9 E1 Y4 \+ m+ l
' The last argument Is a user login name As the sender And 5 C6 F1 M, a+ {
'   If blank will use the logged In user name And
- w- T+ K& }" U: z/ W'   that User Item must have an email address As well.
% R! T( k8 ]# p1 xCCO.Email.SendEmailToIdentity(identity,subject,body,user) * W) O% m0 c# S0 {7 }
/ X% w! D+ M6 y8 o5 B' A
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部