You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Trigger mail in SQR

8 replies [Last post]
Guest's picture
Guest

Hi,

How to Trigger mail in SQR.

Kindly help me out.

Thanks
Piyali

CompShack's picture
User offline. Last seen 6 years 8 weeks ago. Offline
Joined: 12/09/2007
Posts: 167
Send Email?

Are you trying to send an email using an SQR? is that what you mean by "trigger"?

I have done this only once and used a unix command to call an email script. the unix commad looks like this:

!the $command is a string to hold your unix command
Call system using $command #mail_status
If #cat_status <> 0
    show 'ERROR: Could not send email!'
End-If

n/a
P I Y A L I's picture
User offline. Last seen 11 years 44 weeks ago. Offline
Joined: 02/25/2008
Posts: 12
Send mail

Hi..

I got the whole code for this.And it works.

BEGIN-PROCEDURE sendmail
let $subject = 'Subject of the Email Here'
let $to_list = 'email@email.com'
let $ReportID = 'G:\PeopleSoft\Reports\Report_Name.pdf'
let $alias ='Attachment File Name Alias including the file extension'
let $enter = chr(10)chr(13)
let $body_txt = 'Hi,'$enter$enter'Please Find the Report attached with this email.'$enter$enter'Regards,'$enter 'Peoplesoft Application Support'$enter$enter'PS: We request you not to reply to this automated mail trigger.' let $mail-cmd = 'F:\PSFT819\bin\server\winx86\psmail -TO"'$to_list'" -SUBJECT"'$subject'" -BODY"'$body_txt'" -FILE"' $ReportID '" -ALIAS"'$alias'"'
CALL SYSTEM USING $mail-cmd #Status
end-procedure

Warm Regards,
P I Y A L I

Warm Regards,
P I Y A L I

CHANDAN's picture
CHANDAN (not verified)
hi

I tried usin the procedure in my sqr ,but on execution ,it is giving some errors..lik:its not recoznizing the $mail-cmd -invalid variable or function name

CompShack's picture
User offline. Last seen 6 years 8 weeks ago. Offline
Joined: 12/09/2007
Posts: 167
Where is the psmail?

Hi Chandan,
The script above points to the psmail that is located "'F:\PSFT819\bin\server\winx86\psmail", but this might not be the case in your situation.

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog

Ashar's picture
User offline. Last seen 4 years 39 weeks ago. Offline
Joined: 03/26/2008
Posts: 227
You should mention the exact

You should mention the exact path for the psmail.exe in your app server.
Change the code according to your environment and requirement.

Thanks,

Ashar

CHANDAN's picture
CHANDAN (not verified)
Re: Trigger mail in SQR

Hi All ,
First of all thanx for the responce ..........act before execution ,I had changed the path to psmail.................

Thnxs again...........

Guest's picture
Guest (not verified)
Re: Trigger mail in SQR

Hi Im trying to send an email with an attachemnt...

The attachment was posted to the psreports folder in webserver.
But my code are pointing to the appserver... pls help...

let $enter=chr(10)
let $EMAIL='Naalera.MohdYaacob@acs-inc.com'
Let $File = '/opt/vendor/psoft/pt846/psreports/CBPSMYDV/20090707/44814/cbniceni_04.pdf'
let $BODY = 'Hi Attach is the Civil Union Report.'

let $system_command ='psmail -TO"'||$EMAIL||'" -SUBJECT"Civil Union'||'" -BODY"'||$BODY||'" -FILE"' ||$File||'"'
Call system using $system_command #call_status

Above path '/opt/vendor/psoft/pt846/psreports/CBPSMYDV..... is ponting to appserv instead of webserver.. how to change to web server...

Peter.Wan's picture
User offline. Last seen 11 years 15 weeks ago. Offline
Joined: 08/13/2009
Posts: 9
Re: Trigger mail in SQR

Hi P I Y A L I,
Thank you for your code share.

Warm Regards,
Peter.Wan