PLM之家PLMHome-国产软件践行者

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

[复制链接]

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

admin 发表于 2018-8-1 14:08:15 |阅读模式

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
( b4 A" I- H* k( bUse the CCO.Email object to send email messages.
" `' U0 o5 [$ cC#  & N' i- q9 I# D6 q
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
; x$ H7 y0 j- K1 K) q0 Y  cemail.From = fromEmail; 3 B: q( k3 }0 L3 R& d
email.To = toEmail;
1 e: b7 `- a5 ]; E0 P, Femail.Subject = subject;
: k8 w1 o9 k. H! cemail.Body = body;
; \" p  y# G/ J8 K8 R* Z# cCCO.Email.setup_smtpmail_server_and_send(email); ) I" O8 N/ {9 M# V' |
. }- G, x, s5 u
// Alternatively use the SendEmailToIdentity
) a# s  q9 y2 y// The first argument is the Identity name to send the email message.   J) P9 _/ p. b5 a, W  z. \* x
// The second argument is the subject text.
/ \4 y4 W/ @* B" A// The third argument is the email body text. # c* n' X) P: }* p; j
// The last argument is a user login name as the sender and
( c( n9 v* \) q# T$ I2 p//   if blank will use the logged in user name and % u4 r0 ^3 a# P+ f, F
//   that User Item must have an email address as well. 5 }8 ]1 b. c: c( d: v2 [
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 1 c! U* r1 V- N  ^! y  u, D2 Z+ J3 B9 O
return this.newInnovator().newResult("ok");
9 l; S8 \0 Q" P: g: }) c, b  VB.Net  
* N, L8 K3 d. t! h9 YDim email = New System.Web.Mail.MailMessage()
6 O* G7 X: O' ?$ q. _6 O( eemail.From = fromEmail - f+ A+ N8 N4 ^/ s: h& {
email.To = toEmail
2 ~  l7 A6 k; S- memail.Subject = subject ! n4 K+ {( E. H& r6 Y
email.Body = body
" W! t9 r/ s7 c' w# g* n" o5 LCCO.Email.setup_smtpmail_server_and_send(email) % t9 b2 ]# ?# F5 s! j9 d8 C0 v9 E

1 U  t  W) i2 [" `' Alternatively use the SendEmailToIdentity
' S5 }; M0 O# J! `( w2 \' The first argument Is the Identity name To send the email message.
3 Z" W# H3 C' M* n' The second argument Is the subject text.
, V' g# x6 F4 E1 Z) u6 T9 {' The third argument Is the email body text.
& o) O* |8 W( n- `' The last argument Is a user login name As the sender And
# n, b- N" c" {. o) k8 j5 u/ k'   If blank will use the logged In user name And
* e( I( q. q1 a6 v0 X'   that User Item must have an email address As well. 9 d1 X: m: K: k5 k
CCO.Email.SendEmailToIdentity(identity,subject,body,user) / m- }# k4 O1 ~3 p$ j" W

" \, y! B/ `. G
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了