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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  5 V5 M! w% o$ V, f2 L- d
Use the CCO.Email object to send email messages. % z9 x( s; c: A& r# }
C#  1 X% @  S8 {0 ?3 I; m
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
- O9 W" i! B1 U6 Q3 `email.From = fromEmail;
+ K" x5 [1 c0 v7 m. b8 Yemail.To = toEmail;
. g8 z( {! g- o$ N4 demail.Subject = subject; # q. i7 w; ~& E! V
email.Body = body;
% F7 b1 n8 t% _# k4 P, B$ v5 uCCO.Email.setup_smtpmail_server_and_send(email); , d# s1 S# ~0 s8 I0 j7 b

3 Q, p* m) i1 v// Alternatively use the SendEmailToIdentity # @1 X& k3 K: k/ e
// The first argument is the Identity name to send the email message.
  f3 _2 s  i- k& j3 v  B// The second argument is the subject text.
/ P' K7 C  T$ i! A// The third argument is the email body text. # K% J7 X5 w: v2 x& X  \- q  p: j
// The last argument is a user login name as the sender and : A7 v: @1 [5 B% W  k
//   if blank will use the logged in user name and
0 O0 {( s+ i' B9 g' U//   that User Item must have an email address as well. ; N1 `3 N: q7 Z- E( R
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); ) |3 {% n; Q) {. _; {* q
return this.newInnovator().newResult("ok"); - C) c" S2 w& m* s1 ~. F
  VB.Net  
' _$ x9 k0 z" n! C1 p9 ~Dim email = New System.Web.Mail.MailMessage() . g9 T' n' Z" R- ]! j: I2 ~
email.From = fromEmail 2 D$ ?6 D" j) Q9 D* D
email.To = toEmail
. ^" H+ E. ~5 R# X) zemail.Subject = subject
, R0 a0 ]0 p( r0 u/ G5 Hemail.Body = body + O7 L" e( Y, C) _
CCO.Email.setup_smtpmail_server_and_send(email) . ~5 B. c; _$ D. T( B1 i# X) N2 o
- E0 e* `3 j4 R
' Alternatively use the SendEmailToIdentity . ?; i( \( C6 q# x/ F5 L, q' ^
' The first argument Is the Identity name To send the email message. ! E, m" T+ C- T
' The second argument Is the subject text.
- T0 q" |4 N0 h: A: f2 U4 w1 P1 u' The third argument Is the email body text. " h6 V# d2 P8 {3 l, ~$ P
' The last argument Is a user login name As the sender And
4 T; b7 v" Q( _'   If blank will use the logged In user name And   R! Q( H" S* @% B: o+ }) [1 _
'   that User Item must have an email address As well.
3 X9 ?1 p- Q# e% l# FCCO.Email.SendEmailToIdentity(identity,subject,body,user)
: g& V/ y1 b. L! M
5 w6 |3 D7 K8 `* o; {6 m
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了