查看: 3952|回复: 0

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

[复制链接]

4

主题

3

回帖

38

积分

管理员

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

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

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

×
Technique  
) ~, e9 e! c+ Z! gUse the CCO.Email object to send email messages. 5 j) Z( n6 U- t; Q0 k& h) a
C#  " o* w& b) Z8 x6 v
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
4 ]  |) r9 t( c3 F% P' f9 vemail.From = fromEmail; 9 l7 \! R* g3 l7 u5 K. e
email.To = toEmail; ! k% a/ M1 e* m9 w$ B
email.Subject = subject;
( j) n: I8 U' g% B, Y- Pemail.Body = body;
  `* a5 q& w: m& k4 l9 O. GCCO.Email.setup_smtpmail_server_and_send(email); 1 s0 P2 _* l: K' z" s6 N

+ P$ _+ P, S' `4 l2 A8 {- i; T// Alternatively use the SendEmailToIdentity 3 H+ Z+ F  b5 U2 }
// The first argument is the Identity name to send the email message. 5 G' U. i3 Q; G/ F4 e' N
// The second argument is the subject text.
% o$ M! V0 C1 M/ v// The third argument is the email body text. 5 I# b6 ?4 r% E+ h. j6 V
// The last argument is a user login name as the sender and % W6 j/ i/ Z9 C+ O: s9 [, e
//   if blank will use the logged in user name and
/ w6 \* G; S; g* |+ g//   that User Item must have an email address as well. 8 Z; Y& v. C* V. @& u, J6 u, m% ~
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
& R  d6 _7 S& D! |3 Rreturn this.newInnovator().newResult("ok"); 1 X7 {7 }8 R- [3 g* {# `
  VB.Net  
. O8 g1 P* g& T/ ]& M4 Y9 {Dim email = New System.Web.Mail.MailMessage() % J' R% J+ Q0 K5 W4 D1 A$ W
email.From = fromEmail
, U2 n" k* R/ aemail.To = toEmail
4 h+ f. a, }9 a/ ~email.Subject = subject 4 |0 N' [; v8 O  |& E% O4 q
email.Body = body * x* j8 g! n* Z) F: u9 q: ^% z
CCO.Email.setup_smtpmail_server_and_send(email)
  T' [' {0 p4 p& G; F* d & d& I; ^7 e  K: f& b$ f4 O
' Alternatively use the SendEmailToIdentity ! d% T$ P: S2 C  i8 O6 b$ s
' The first argument Is the Identity name To send the email message.
' X6 C% x! I# X/ ?/ |. b' C8 x8 I' The second argument Is the subject text.
% C) j5 G( q* w1 \) C  c% N3 z) j8 Y' The third argument Is the email body text.
& {/ K- ]. G( |7 Q$ y' The last argument Is a user login name As the sender And # H! P% m5 v1 a
'   If blank will use the logged In user name And 2 S: F% ^2 ^* p
'   that User Item must have an email address As well.
+ Q  Y( {" o. a2 }. G4 uCCO.Email.SendEmailToIdentity(identity,subject,body,user) + j$ q2 {* t$ D3 Y, X

& `6 v0 u  N% M1 Y) X7 |
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

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

本版积分规则

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