|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服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 = ∓
- 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;
复制代码
|
|
|