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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
& h' H8 g0 f' T( l, V2 o5 PUse the CCO.Email object to send email messages. # M5 s& E( X/ {: J
C#    g3 S* o3 s* v; J7 C0 f
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
+ T& O: b# A; `% _# {9 q. Semail.From = fromEmail;
9 S% `2 P4 R  `: m( Femail.To = toEmail;
7 F6 n( {) K' \email.Subject = subject; 2 x) i2 {! ?! K" @
email.Body = body;
4 F5 V" o9 ^" T* iCCO.Email.setup_smtpmail_server_and_send(email); $ {! M1 J- ?% q1 j% P  H

. l% V  M  L$ K. \( A3 D& I4 [// Alternatively use the SendEmailToIdentity - n$ e! b0 U0 l+ f9 f$ G
// The first argument is the Identity name to send the email message. & g8 U3 ?9 V! @  u  j9 @
// The second argument is the subject text.
, Q) h: b5 p2 R8 M) V4 M9 \5 g// The third argument is the email body text. ( f+ v$ y/ P: n  G2 m
// The last argument is a user login name as the sender and
  m" F/ A7 g, P$ J//   if blank will use the logged in user name and 5 u+ ~# `( j2 a: g1 {$ F
//   that User Item must have an email address as well. : _; K8 l2 N$ w) v+ s1 K  s8 u
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 5 ?3 V3 I  J1 J* f  `) G& c0 l
return this.newInnovator().newResult("ok"); ; A% u6 R+ K7 O5 [0 J. s' k7 K
  VB.Net  6 z9 s' h: M6 u" P# ^" ?' A1 d
Dim email = New System.Web.Mail.MailMessage()
) K$ p" P6 W1 P! q& eemail.From = fromEmail 4 }8 ~; R" q% T! I" t
email.To = toEmail
4 l4 f$ N$ m1 `4 [" q- Jemail.Subject = subject
& l: z6 y! p& _3 |4 h( g- ^email.Body = body - K7 ^. v. A9 r1 P1 S+ G9 b+ S' S' Q- k
CCO.Email.setup_smtpmail_server_and_send(email) $ b  B+ |) P; z. c5 {

' a  t! M& s/ Z! q' Alternatively use the SendEmailToIdentity
1 b! Q9 U  o+ i; m: _' The first argument Is the Identity name To send the email message. ) @+ G: |6 m' f% J% \$ N& x& x4 T
' The second argument Is the subject text.
6 D( W5 T" j" \* P2 k' The third argument Is the email body text. 7 c, U! m) p2 [
' The last argument Is a user login name As the sender And
6 b5 o! s: T1 X: v'   If blank will use the logged In user name And
  Z# ]" \$ c0 R( t) {, l'   that User Item must have an email address As well. 4 e* P2 e3 d7 g! z% R
CCO.Email.SendEmailToIdentity(identity,subject,body,user) ' o- _3 K+ v1 H8 [$ s& ~

$ y5 x: ~) n( I9 ?( Z0 \
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了