壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 559|回复: 1

PeopleCode 发送邮件并给邮件添加附件

[复制链接]
发表于 2013/5/8 10:38:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

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

x
  • <P><SPAN style="WIDOWS: 2; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; DISPLAY: inline !important; FONT: 12px 'Courier New', Courier; WHITE-SPACE: pre; ORPHANS: 2; FLOAT: none; LETTER-SPACING: normal; COLOR: rgb(128,0,0); WORD-SPACING: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"></SPAN> </P>

复制代码

  • import PT_MCF_MAIL:*;
  • Local PT_MCF_MAIL:MCFOutboundEmail &email =
  • create PT_MCF_MAIL:MCFOutboundEmail();
  • &email.From = &FromAddress;
  • &email.Recipients = &ToList;
  • &email.Subject = &Subject;
  • Local string &plain_text = "Hi there!";
  • Local PT_MCF_MAIL:MCFBodyPart &text = create PT_MCF_MAIL:MCFBodyPart();
  • &text.Text = &plain_text;
  • Local PT_MCF_MAIL:MCFBodyPart &attach1 = create PT_MCF_MAIL:MCFBodyPart();
  • &attach1.SetAttachmentContent("Ocean Wave.jpg", %FilePath_Relative,
  • "Ocean Wave.jpg", "Ocean Wave", "", "");
  • /* %FilePath_Relative indicates the file is available at Appserver's FILES?
  • dierctory */
  • Local PT_MCF_MAIL:MCFBodyPart &attach2 = create PT_MCF_MAIL:MCFBodyPart();
  • &attach2.SetAttachmentContent("///file:C:/User/Documentum/XML%20Applications?
  • /proddoc/peoplebook_upc/peoplebook_upc.dtd",
  • %FilePath_Absolute, "Sample.jpg", "Sample", "", "");
  • /* The Sample.jpg is available in the "public" folder of my-server machine*/
  • Local PT_MCF_MAIL:MCFMultipart &mp = create PT_MCF_MAIL:MCFMultipart();
  • &mp.AddBodyPart(&text);
  • &mp.AddBodyPart(&attach1);
  • &mp.AddBodyPart(&attach2);
  • &email.MultiPart = &mp;
  • Local integer &res = &email.Send();
  • Local boolean &done;
  • Evaluate &resp
  • When %ObEmail_Delivered
  • /* every thing ok */
  • &done = True;
  • Break;
  • When %ObEmail_NotDelivered
  • /*-- Check &email.InvalidAddresses, &email.ValidSentAddresses
  • and &email.ValidUnsentAddresses */
  • &done = False;
  • Break;
  • When %ObEmail_PartiallyDelivered
  • /* Check &email.InvalidAddresses, &email.ValidSentAddresses
  • and &email.ValidUnsentAddresses; */
  • &done = True;
  • Break;
  • When %ObEmail_FailedBeforeSending
  • /* Get the Message Set Number, message number;
  • Or just get the formatted messages from &email.ErrorDescription,
  • &email.ErrorDetails;*/
  • &done = False;
  • Break;
  • End-Evaluate;

复制代码


发表于 2013/7/28 18:40:17 | 显示全部楼层
哎,又是我的帖子被复制了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 03:21 , Processed in 0.011586 second(s), 14 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表