查看: 3959|回复: 0

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

[复制链接]

4

主题

3

回帖

40

积分

管理员

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

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

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

×
Technique  
4 }) H' I8 Q, ?& w6 B0 z/ P( FUse the CCO.Email object to send email messages.
" P9 q& r6 D# l  I- M/ D% sC#  6 k( |: y3 P6 o( T' `
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); " p8 z% y4 ~8 T$ o: b* }+ K5 b0 h
email.From = fromEmail; $ U4 E* |0 n9 s& r2 h& u9 F
email.To = toEmail;
$ O$ g9 s- H  s  z. aemail.Subject = subject;
$ j4 V' a7 e# Zemail.Body = body;
% M0 n" c% E4 E9 b, @% HCCO.Email.setup_smtpmail_server_and_send(email); , d$ h: T; v5 n) V
7 ]5 X. G! \" a. I( F
// Alternatively use the SendEmailToIdentity
. @5 q; F& _4 x// The first argument is the Identity name to send the email message.
( X9 i: e) n4 B, A+ g! G) L// The second argument is the subject text.
1 F: z0 I$ Y. d, S6 Q// The third argument is the email body text.
4 z( b& Q( a! _3 B1 N( s4 y' q// The last argument is a user login name as the sender and   U( l) N7 C$ p- ]' X1 R% ^/ f, F
//   if blank will use the logged in user name and
) ~7 ~) [! X7 }: \0 ]//   that User Item must have an email address as well. % x6 u1 T1 d+ e. D% T
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);
$ ^4 Q$ ?; \/ L) Y: @return this.newInnovator().newResult("ok");
7 }- D9 Y5 x! P  VB.Net  2 ^& w% }9 i1 [2 l
Dim email = New System.Web.Mail.MailMessage() . _1 w4 b7 }9 V0 p/ o) Q5 l; U
email.From = fromEmail ' a5 H6 n9 l$ F9 I
email.To = toEmail . t2 l7 {$ r6 ^/ @# e
email.Subject = subject
. h3 T+ y7 C1 k) x* Temail.Body = body
5 S, a( K( A2 [1 X5 h: P4 x# TCCO.Email.setup_smtpmail_server_and_send(email)
! I- Z$ J" \& T) {2 c* b& P5 }
9 S# ?, w, q1 ?* O0 Y0 v4 y0 S% o0 w  |' Alternatively use the SendEmailToIdentity ! f* w$ B! ~' P8 _: N; }
' The first argument Is the Identity name To send the email message. ! U( [& f1 _. b4 I. C' M
' The second argument Is the subject text.
" r' u. z4 h8 M, R, M( c' The third argument Is the email body text.
' \8 O- U, A3 D) j; h' The last argument Is a user login name As the sender And 2 G, S0 ?- R; s+ _8 n
'   If blank will use the logged In user name And
0 J; |2 z7 M+ C& M6 L% a* B'   that User Item must have an email address As well.
) D- `- H7 W4 j6 ?; i5 SCCO.Email.SendEmailToIdentity(identity,subject,body,user) # Q- b# t* H* p; F8 F

( N% G8 y( s+ t/ F
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

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

本版积分规则

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