PLM之家PLMHome-工业软件与AI结合践行者

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

[复制链接]

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

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

admin 楼主

2018-8-1 14:08:15

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

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

x
Technique  
0 y$ y: \4 Q/ `( [, }" @Use the CCO.Email object to send email messages. 2 f6 r0 B' [$ e8 n9 l
C#  
% Q  w; \, g/ tSystem.Web.Mail.MailMessage email = new System.Web.Mail.MailMessage();
& @7 Y. g% E; d  b, {+ Semail.From = fromEmail; 7 u, g0 ^; {1 j
email.To = toEmail; , I2 g) {* g, L( V
email.Subject = subject;
% _- a! d9 d  l8 Kemail.Body = body;
$ ~$ s6 ~2 Y8 Q& m8 U; s3 W' kCCO.Email.setup_smtpmail_server_and_send(email);
' ^7 x: s, l0 _4 u( C' ?# y, S ' q3 y1 S8 A1 q& [$ w- o  T! r
// Alternatively use the SendEmailToIdentity
* R4 Q7 @& Q4 {3 @// The first argument is the Identity name to send the email message. 9 W: e, M/ I. l" q1 i9 F
// The second argument is the subject text. ( D$ b$ T6 U2 Y' ~* s/ k. H
// The third argument is the email body text.
9 m  d5 m3 n: K* q3 D// The last argument is a user login name as the sender and
, w; r, V1 t: Z//   if blank will use the logged in user name and 2 _0 W/ O) c5 G% g5 O
//   that User Item must have an email address as well. . M! n# d/ e; p, L1 @
CCO.Email.SendEmailToIdentity(ref identity, ref subject, ref body, ref user); . B8 Z. c# c+ ^9 U- O; Y% j$ N% e& I
return this.newInnovator().newResult("ok");
0 Z7 h" I$ C  _" x! w) {# U  VB.Net  ' b" L' z2 R3 r
Dim email = New System.Web.Mail.MailMessage() 4 ^6 k( A- i, Y: I: C$ a0 m% ]# f3 L" J
email.From = fromEmail
+ @2 [+ ^/ e3 G; Gemail.To = toEmail 9 N' N2 U6 R2 {$ k; `, O; _
email.Subject = subject 4 F" U4 P, j! g) X! _
email.Body = body 8 C. p  q9 g" k$ r: |
CCO.Email.setup_smtpmail_server_and_send(email)
6 L; q. ]7 D4 r. O
! ?8 N, P. l+ N6 z, e' Alternatively use the SendEmailToIdentity
. z# G  @3 P" M$ T3 o+ _, Q* a' The first argument Is the Identity name To send the email message. & q3 E) q( |; a
' The second argument Is the subject text. $ S) n) c, a& l5 R; l( |7 Q
' The third argument Is the email body text.
2 p" v) j) b1 G. f' The last argument Is a user login name As the sender And
/ G3 U! Y7 F" a+ Y; \- Q( e) b( U3 I'   If blank will use the logged In user name And
% a3 R/ o, l8 ^'   that User Item must have an email address As well. * W! [, @5 e' Z- x; S; R% X3 g
CCO.Email.SendEmailToIdentity(identity,subject,body,user) " B  a$ E! x: T: D2 A8 n7 {* m
1 v  b* r3 H9 Z+ j  O
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了