Senmail didn't work through shell script when trigger from forms [message #420739] |
Tue, 01 September 2009 23:27 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dayang_aziz@yahoo.com
Messages: 19 Registered: August 2009
|
Junior Member |
|
|
Hi All,
I have a shell script to send email. I manage to run the script when I telnet to the server and called the script directly and I got email in my inbox.
However, when I call the script through froms when trigger WHEN-BUTTON-PRESSED, the script ran but I didnt get the email.
Here is the script:Quote: | #!/bin/ksh
# --------------------------------------------------------------------
# Script: unix_mail_withattachments.ksh
# Aurthor: Ravin Maharaj
# Purpose: Use sendmail to e-mail messages from Unix with
# --------------------------------------------------------------------
mkdir start
SUBJ="Send mail from Unix with file attachments"
TO=dayangku.masmaryam@lityan.com.my
CC=dayangku.masmaryam@lityan.com.my
(
cat << !
To : ${TO}
Subject : ${SUBJ}
Cc : ${CC}
!
cat << !
HOPE THIS WORKS
Hello world.
!
) | sendmail ${TO} ${CC}
mkdir ${TO}
|
The script was successfully executed because there are two directory created at the server name start and dayangku.masmaryam@lityan.com.my. Somehow, I wonder why the sendmail function didn't work.
This is the code at trigger:
Quote: | HOST('cd /home/oramid/dayangTest; ./sendmail2.sh');
|
Could anyone help me regarding this.
Regards,
Dayang
|
|
|
|