查看: 4151|回复: 0

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

[复制链接]

2480

主题

1280

回帖

8万

积分

管理员

PLM之家站长

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

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

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

×
Technique  7 e2 u3 ]8 B; I& m
Use the CCO.Email object to send email messages. 8 [  X: K0 U: U& u
C#  + U* x4 B; U' Y6 Z
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); - U( Y' j! G; Y
email.From = fromEmail; 0 j/ d7 o9 ~6 ~: |/ \4 S* b
email.To = toEmail; : j" {7 Y  }: Q2 C6 A% u. b
email.Subject = subject;
& w; F2 R% O# I8 @! Oemail.Body = body;
. p8 H8 X5 p5 e- Z7 Z- NCCO.Email.setup_smtpmail_server_and_send(email);
) q. i% y' q* I/ O% z
9 ?. G) \7 m3 w, n* y2 R) h// Alternatively use the SendEmailToIdentity 9 L0 Z. s; E9 N+ `0 A* w: v
// The first argument is the Identity name to send the email message.
% E( E# Y- T6 v6 A; h// The second argument is the subject text. , P: z; p2 k. m4 a% B
// The third argument is the email body text. ' L- M: w7 o4 M3 N+ L7 _
// The last argument is a user login name as the sender and
8 ~! ~* r4 @/ C/ d; ?2 n//   if blank will use the logged in user name and
$ k& d3 p6 D0 O, R* h8 h- X//   that User Item must have an email address as well. + r) h) r+ J5 T2 {! ~1 }. w
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);   g! @9 \: k( I" g
return this.newInnovator().newResult("ok"); . c2 A( V3 Z# c5 ~
  VB.Net  
6 T$ z2 h: G8 X" v0 J; m3 J7 A5 XDim email = New System.Web.Mail.MailMessage() $ k+ O3 F0 g: Q+ v
email.From = fromEmail ( X( z  \& V0 W
email.To = toEmail
* {- V% B; F4 H# R( u+ Pemail.Subject = subject
0 W% Q9 w7 w4 @9 ^# Hemail.Body = body 2 C2 Z; S! F/ r. X$ t1 l9 m9 s
CCO.Email.setup_smtpmail_server_and_send(email)
9 X) H% N' I7 e( f+ F. |, {   `% r# J1 f4 z" s
' Alternatively use the SendEmailToIdentity
3 A, r& L+ K* Q- L: x* g' The first argument Is the Identity name To send the email message. 6 v* k6 w: y' v. `* y
' The second argument Is the subject text.
3 {' O( l4 [& `, ?' The third argument Is the email body text. 1 }. k2 R3 j0 [- u
' The last argument Is a user login name As the sender And
4 u+ E4 b  {. O9 b  m: K. @'   If blank will use the logged In user name And
  v1 V& b4 G. e'   that User Item must have an email address As well. 6 z! S' z' e- y% n
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
3 w( j- u( j% W# S' v3 Z- c6 I* l
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

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

本版积分规则

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