Friday, September 10, 2010

A quick way to send an email message from within peoplecode

Simply use the PeopleCode command SendMail to send an email message from a PeopleSoft page. You can simply copy this code and change the values with yours and you'll be sending mail in no time. This is very useful code to use within Application Engine.


REM ****************************************;
REM SEND MAIL MESSAGE;
REM ****************************************;
&FLAGS = 0;
&TO = "email
@youremailaddress.com";
&CC = "";
&BCC = "email
@myemailaddress.com";
&SUBJECT = "Sample Subject"
&TEXT = "This is a sample mail message."
&FILES = "C:\DATA\YOURFILE.TXT"
&RETURN_CODE = SendMail(&FLAGS, &TO, &CC, &BCC, &SUBJECT, &TEXT, &FILES, &TITLES);
If Not (&RETURNCODE = 0) Then
rem WinMessage("Here is the Return Code = " / &RETURNCODE);
End-If;

No comments:

Post a Comment