|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
PeopleBooks 中一段实例代码 小弟想问问怎么样使用,为何我发出的EMAIL 正文都是空的???
import PT_MCF_MAIL:*;
/*-- Create an outbound email object --*/
Local PT_MCF_MAIL:MCFOutboundEmail &eMail =
create PT_MCF_MAIL:MCFOutboundEmail();
/*-- Initialize the usual fields of an email --*/
&eMail.From = &FromAddress;
&eMail.Recipients = &ToList;
&eMail.Subject = &Subject;
&eMail.Text = &MailBody;
/*-- The send method uses the default SMTP parameters as set in the app server configuration file.
This send method makes a connection to the SMTP server, sends the mail and then disconnects.
The result are returned as a number corresponding to the possible values.
The list of ValidSent, InvalidSent and Invalid addresses are returned in the email object itself
----*/
Local integer &resp = &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; |
|