PeopleSoft PT_MCF_MAIL - %ObEmail_Delivered

Found an interesting question in a popular forum today, on PT_MCF_MAIL application package of PeopleSoft. An attempt to send an email with an invalid mail address was triggered, and the package returned success!.

So, I decided to do some test code on this by myself. Placed a small piece of code in the fieldchange event, that triggers an email. Before you try replicating this, make sure that you have configured the SMTP details in your application server configuration file [ psappsrv.cfg ]

The code is presented below

import PT_MCF_MAIL:*;
Local PT_MCF_MAIL:MCFOutboundEmail &outb_email = create PT_MCF_MAIL:MCFOutboundEmail();

&outb_email.Recipients = "Recipient List";
&outb_email.From = "";
&outb_email.BCC = "";
&outb_email.Subject = "Invalid Email";
&outb_email.ReplyTo = "";
&outb_email.ContentType = "text/html";
&result = &outb_email.Send();
WinMessage("Result  -" | %ObEmail_Delivered, 0);

The ideal expectation here is an error / mail rejection, as the recipient list is invalid. But strangely, %ObEmail_Delivered returns a value of 1 indicating the email was successfully delivered.

I decided to set the "Logfence" property in the application server configuration file to 5, to see what happened inside the code. Here is a trace.

PSAPPSRV.15750 (2) [04/28/10 09:46:41 VP1@<IP> (IE 7.0; WINXP) ICPanel](4) (MCFSendMail): Inside EvalSendMCFEmail
PSPUBDSP_dflt.15793 (0) [04/28/10 09:46:42](4) Number of calls queued in PUBHQ_dflt is:0
PSAPPSRV.15750 (2) [04/28/10 09:46:42 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Creating CMCFPart
PSAPPSRV.15750 (2) [04/28/10 09:46:42 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Creating CMCFEmail
PSAPPSRV.15750 (2) [04/28/10 09:46:42 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Creating CMCFOutboundEmail
PSAPPSRV.15750 (2) [04/28/10 09:46:43 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Creating CSMTPSession
PSAPPSRV.15750 (2) [04/28/10 09:46:43 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Inside CMCFOutboundEmail::Send
PSAPPSRV.15750 (2) [04/28/10 09:46:43 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Inside CMCFOutboundEmail::ConvertToJavaObj
PSAPPSRV.15750 (2) [04/28/10 09:46:43 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Creating Java equivalent of CSMTPSession
PSAPPSRV.15750 (2) [04/28/10 09:46:43 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Inside CMCFEmail::ConvertToJavaObj
PSAPPSRV.15750 (2) [04/28/10 09:46:43 VP1@<IP> (IE 7.0; WINXP) ICPanel](5) (MCFSendMail): Inside CMCFPart::ConvertToJavaObj
PSAPPSRV.15750 (2) [04/28/10 09:46:43 VP1@<IP> (IE 7.0; WINXP) ICPanel](4) (MCFSendMail): Inside CMCFOutboundEmail::Send: Successful send with return value 1

It appears that it is not validated, but an email sending attempt has been made. Weird, but will keep dwelling on this to see what happened at the mail server.

4 comments:

  1. Hi,

    I'm trying to send an outbound email, but ends up in an exception as found the application server log file..

    SendMailException: Detail Message:JavaMail Error: javax.mail.MessagingException: IOException while sending message;
    nested exception is:
    java.io.FileNotFoundException:(No such file or directory).\nStack Trace:\njavax.mail.MessagingException: IOException while sending message;
    nested exception is:
    java.io.FileNotFoundException:(No such file or directory)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:421)
    at com.peoplesoft.pt.mcf.mail.MCFOutboundEmail.send(MCFOutboundEmail.java:660)
    at com.peoplesoft.pt.mcf.mail.MCFOutboundEmail.send(MCFOutboundEmail.java:828)

    can you help me with this?

    ReplyDelete
  2. @Murugavel

    Looks like you are trying to send an email with an attachment and PeopleSoft is not able to find the attachment file. (FileNotFound Exception).Check where you are generating the file and where it is available when you invoke sendmail.

    ReplyDelete
  3. yes, you are right.fixed the issue. thanks

    import PT_MCF_MAIL:*;

    Local PT_MCF_MAIL:MCFMultipart &multipartobj = create PT_MCF_MAIL:MCFMultipart();
    Local PT_MCF_MAIL:MCFOutboundEmail &sendmailobj = create PT_MCF_MAIL:MCFOutboundEmail();
    Local PT_MCF_MAIL:MCFBodyPart &htmlpart = create PT_MCF_MAIL:MCFBodyPart();




    &sendmailobj.From = "Noreply@test.com";
    &sendmailobj.Subject = "Test";
    &sendmailobj.Recipients = "mgtest@test.com";
    &htmlpart.Text = "Test email with attachment";
    &htmlpart.ContentType = "text/html";
    &multipartobj.AddBodyPart(&htmlpart);
    &sendmailobj.MultiPart = &multipartobj;


    &htmlpart.AttachmentURL = "c:\temp.xls";
    &htmlpart.FilePathType = %FilePath_Absolute;
    &htmlpart.FileName = "temp.xls";
    &sendmailobj.ContentType = "text/html";

    Local integer &sendstatus = &sendmailobj.Send();


    Evaluate &sendstatus
    When %ObEmail_Delivered

    Break;

    When %ObEmail_NotDelivered

    Break;

    When %ObEmail_PartiallyDelivered

    Break;

    When %ObEmail_FailedBeforeSending


    Break;

    End-Evaluate;

    ReplyDelete
  4. Thank you for posting this to your Blog. I had the same issue and you solved my problem.

    ReplyDelete