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

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

[复制链接]

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

2471

主题

1276

回帖

8万

积分

管理员

PLM之家站长

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

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

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

x
Technique  
3 E) V6 l2 L* r$ Q; rUse the CCO.Email object to send email messages.
8 u4 m: N4 W$ z1 e# R+ eC#  
7 a) O# `( ^$ G$ V! I2 a; S6 p6 FSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage(); ) K9 U3 j* ~" a- F
email.From = fromEmail;
9 W; z4 P. \8 D4 H$ @, v  J' jemail.To = toEmail; 1 f5 [6 F: N$ _+ k/ [* R
email.Subject = subject;
- N' [/ j) X& n! O% x+ \9 ^email.Body = body; 4 P* w! T4 S3 u  e* P6 v% p
CCO.Email.setup_smtpmail_server_and_send(email); 9 m, c1 m4 y- l; K" V+ D$ Z: q
, x8 d0 b  }- \
// Alternatively use the SendEmailToIdentity
& |$ C0 B- A# Q- R4 U// The first argument is the Identity name to send the email message.
% \% J5 e0 R- x% r$ i* p& N  B// The second argument is the subject text. ' s2 [+ |2 G( u7 t8 [
// The third argument is the email body text.
" p" s5 h( Y$ `( N// The last argument is a user login name as the sender and % ~/ W6 l9 E; Z8 c& Q3 Y" ~6 C
//   if blank will use the logged in user name and 5 d& T& B! G- k
//   that User Item must have an email address as well.
/ O$ _# e- d# D3 W, ~2 J$ u" Y8 S( GCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user);   t7 s  X& x: B( k& ]
return this.newInnovator().newResult("ok"); # p$ O8 z7 x, x- h* D
  VB.Net  5 s8 c+ ?7 S- q
Dim email = New System.Web.Mail.MailMessage() 3 [! p" Y/ L: w2 K) @
email.From = fromEmail
1 ~/ K, g3 _: R2 E9 [email.To = toEmail
! Q& T- k. n3 Q; V- @; r  semail.Subject = subject
5 d2 }2 S9 K+ y- N7 i8 U& b, Z' |" Oemail.Body = body ! o4 i% O0 C( k9 y
CCO.Email.setup_smtpmail_server_and_send(email) , ]7 q# b. {  S5 V  F: v! p: `2 @

, g/ j8 P7 y7 Y' p! |! ^' Alternatively use the SendEmailToIdentity
- `# \" \4 r  S' o& Y  j' The first argument Is the Identity name To send the email message.
6 C" u1 G" n+ {* m3 a! k' The second argument Is the subject text. * Y! u  L/ E1 N9 T
' The third argument Is the email body text.
- z% v, Q% ?, q* l' }' The last argument Is a user login name As the sender And ! R' @# w; b- r" H3 n. R* B  V
'   If blank will use the logged In user name And
5 L6 v! w8 Z  r/ {'   that User Item must have an email address As well.
) _" I4 w5 o( b/ @# [CCO.Email.SendEmailToIdentity(identity,subject,body,user) 0 O$ x0 p$ t& c* P0 {- k

& U9 S  t5 H5 j/ J
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了