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

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  . g* O; J, s9 m3 s0 P+ X1 r
Use the CCO.Email object to send email messages.
" y4 u# P) W/ C6 ~) |2 qC#  ( F* a  M2 u: @, D: c/ o. m9 N4 r/ h
System.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& i% L7 M9 r' xemail.From = fromEmail; $ J3 s% U$ F$ x# W
email.To = toEmail; 3 F5 k3 d0 Z/ p/ \- p1 a
email.Subject = subject;
! r$ y+ v7 F! u+ X- m# e" S3 N1 memail.Body = body; + }- e# U8 H  ~3 k$ h4 ~
CCO.Email.setup_smtpmail_server_and_send(email); 9 k0 V3 P$ f& Z# b. E8 q+ U9 [

: V5 s7 S( k- C9 c$ \" ^5 O4 l// Alternatively use the SendEmailToIdentity : \& r' v  Q+ o* ~. E/ |% t
// The first argument is the Identity name to send the email message.
; a) S+ M2 |! O+ ~// The second argument is the subject text. 9 ~4 b, C1 |/ _+ D3 p% W
// The third argument is the email body text. % N2 S; u$ `& f! d& G  [
// The last argument is a user login name as the sender and " E( z8 ^+ u! e: a+ U! K
//   if blank will use the logged in user name and
% B% M6 C& Y  k0 d3 T  c- S2 y//   that User Item must have an email address as well.
8 j9 i2 a  O( t# FCCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); 6 w  J; L' Z4 _" G
return this.newInnovator().newResult("ok"); $ c5 g$ f, P' Q
  VB.Net  5 Y0 P0 N, Q4 a# G5 k2 _$ g5 e$ T
Dim email = New System.Web.Mail.MailMessage() % ~2 I' Y$ u; Y7 E, \# U8 `, }7 |
email.From = fromEmail / q6 @( j7 j( D4 ^: g
email.To = toEmail 4 O6 U' e) X# h( p
email.Subject = subject
! \) t6 q7 k" N( _. t9 q$ B$ Jemail.Body = body # D" A5 I% ^: H3 V6 D) O
CCO.Email.setup_smtpmail_server_and_send(email)
( b+ w0 `% x' Q1 h / @. Y. ?3 Y/ L: r2 j* u2 Y
' Alternatively use the SendEmailToIdentity 2 Y: d3 I3 i, u  Y
' The first argument Is the Identity name To send the email message. ) H" J% M0 d0 ~# y( T  ^* b$ z( D' @
' The second argument Is the subject text. : ]3 R% Q# T  \* F5 Q
' The third argument Is the email body text.
% V" d5 X" q0 g# \9 T2 z' The last argument Is a user login name As the sender And
' D* ^1 ]: [9 V# R+ [! ?; Y'   If blank will use the logged In user name And 1 ~# |3 I$ c2 v4 n( Y
'   that User Item must have an email address As well. , m0 ^4 l0 \$ r/ j' W. W
CCO.Email.SendEmailToIdentity(identity,subject,body,user)
$ K' i, z/ ^3 j0 a$ `3 V7 P' D: K4 `9 ~9 |; j0 _* a
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了