How to Send Email Using PeopleCode

In this Article we can find how to send email using peoplecode
Function SendMAilfromSetupMailInfo (&ReceiverName As string, &MAIL_TO As string) Returns boolean
Local PT_MCF_MAIL: MCFOutboundEmail &ObjectEmail = create PT_MCF_MAIL: MCFOutboundEmail();

/*-- Initialize the usual fields of an email --*/

&ObjectEmail.From = "email@abc.com";
&ObjectEmail.ReplyTo = "email@abc.com ";
&ObjectEmail.Recipients = &MAIL_TO;
&ObjectEmail.Subject = MsgGetText (20050, 142, "");
&ObjectEmail.Text = MsgGetExplainText (20050, 141, "", &PersonName, &MAIL_TO);
&ObjectEmail.AddHeader("Errors-To", "email@abc.com");


Local integer &resp = &ObjectEmail.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;

Return &done;
End-Function;



SHARE

peoplesoft

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

2 comments:

  1. Not too long ago, I did not give a lot of thought to making comments on blog page articles and have placed feedback even much less. Reading by way of your pleasant article, will support me to do so sometimes.
    Minh Farfalla


    Ro water purifier
    UF water purifier
    Hydrogen water bottle

    ReplyDelete
  2. thank you to help making people more aware of possible issues.Great stuff as usual.
    Keep working, nice post! This was the stuff I needed to get.
    Thought I would comment and say great theme, did you design it on your own? Its really great!
    negative ion generator reviews consumer reports
    air purifier made in germany
    meat purifier

    ReplyDelete

Phaniraavi@gmail.com