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

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

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

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

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

x
Technique  5 g; B4 z: ^# }" v
Use the CCO.Email object to send email messages.   _# @: o8 ]( p4 ~) V' q- ~
C#  * q' q5 ^% v) p& f- T/ j
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
' Q9 n$ F" T, jemail.From = fromEmail; . i$ c& D0 q8 v7 D/ r' }
email.To = toEmail; ; a8 T1 f; y2 J+ t1 h8 B9 E1 e
email.Subject = subject; ( N8 X' F0 N  ^( U, u# d; L# _5 v
email.Body = body; , t$ o6 V) k) q. ?- {! J
CCO.Email.setup_smtpmail_server_and_send(email);
$ f, D* Z; I; C6 C% K ; P- V5 O9 g6 z! I7 }
// Alternatively use the SendEmailToIdentity 8 s$ w# N; N! d) e2 b9 i6 F% m2 v
// The first argument is the Identity name to send the email message.
  s( O/ _" z% t1 Z+ u! @% y8 C  L// The second argument is the subject text.
: k' B  K" W2 }( P& ]. ~// The third argument is the email body text. 5 Y2 r* c* p% a+ k& D9 A. a8 G" t5 m
// The last argument is a user login name as the sender and
. K& `/ X' r* k- s; ~: a2 l//   if blank will use the logged in user name and ) x$ J# O+ t2 S3 `+ w3 y; D& P
//   that User Item must have an email address as well. & g; V' N; R% S) w- n& Z5 T1 W, f
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); " g* s% q8 {0 z% ^- K
return this.newInnovator().newResult("ok");
6 i7 c. u6 ^' |9 H! v7 s- ~  VB.Net  ' c; a1 i& S6 l% C4 o/ S! u6 P
Dim email = New System.Web.Mail.MailMessage()
% H* n( z0 v" N) e; `* r" iemail.From = fromEmail
6 w& |3 n* a3 ^- x3 k  k2 g0 ?email.To = toEmail
" M4 }7 a. c* o/ Zemail.Subject = subject ; Y! Z! y' s3 l0 ^4 s
email.Body = body * Q5 i8 s) z  |* k. E$ C
CCO.Email.setup_smtpmail_server_and_send(email)
0 j# K! A3 k; P( _3 S  Y
  y0 _: a0 G0 q+ I+ m' Alternatively use the SendEmailToIdentity ) F2 ^5 D; G, I' c' S1 P) o
' The first argument Is the Identity name To send the email message.
; m! I7 l/ n6 A8 b5 c& B' q: J' The second argument Is the subject text.
& P5 \5 ?' l. o8 E0 N' The third argument Is the email body text. / c$ b+ ]; H( X, I% v& |
' The last argument Is a user login name As the sender And 7 s0 ~0 V( Y$ t
'   If blank will use the logged In user name And
! M& S+ o) Q' }' g  S5 a'   that User Item must have an email address As well. 3 P" L+ q/ K! y% f' T! J
CCO.Email.SendEmailToIdentity(identity,subject,body,user) ( S/ A% D8 Q; \6 {- W
) Q" k9 o+ x, ?, I" _
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了