problem mailing HTML code in cron file.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users problem mailing HTML code in cron file.
# 1  
Old 09-25-2008
problem mailing HTML code in cron file.

Hi All,
I have written a script which sends mail using “sendmail” command and mail contains HTML code.

When I run scripts on terminal it is working properly, but when I try to run this script through a crontab file it sends blank mail with proper subject.

crontab file detail :
00 05 * * * su - inputdec -c /idhome/abhishek/bin/cr_trigger.sh

Sample code :

echo "To: abhishek.abc@gmail.com"
echo "X-Mailer: htmlmail" $VERSION
echo "Mime-Version: 1.0"
echo "Content-Type: text/html; charset=iso-8859-1"
echo $SUBJECT
#mail content
cat abhihek/temp3.html
} | /usr/lib/sendmail abhishek.abc@gmail.com
Can anybody help me??


Last edited by abhishek.mind; 09-25-2008 at 05:41 AM..
# 2  
Old 09-25-2008
Use an explicit absolute path for the file.

You seem to be missing the Content-Transfer-Encoding header.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need syntax for mailing in UNIX by using html file as body and along with attachment

Hi All, I need a syntax for mailing in unix by using html code file output as body and along with attachment (without using mutt command) HTML code file : html1.txt Attachment : attach1.txt I was using the below codes but they are not working. ( cat html1.txt ; uuencode attach1.txt... (4 Replies)
Discussion started by: Rokkesh
4 Replies

2. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

3. Shell Programming and Scripting

"Content-type: text/html No input file specified." Only in CRON but not when executed directly

Hi gang, I have the following code inside a the file script.sh #!/bin/bash todaysdate=$(date --date='7 day' +'%d') todaysmonth=$(date +'%m') todaysyear=$(date +'%Y') yahoodatestring=$todaysyear$todaysmonth$todaysdate nicedate=$(date --date='5 day' +'%A') nice="$nicedate,... (2 Replies)
Discussion started by: phpchick
2 Replies

4. Shell Programming and Scripting

HTML code upload text file grep through shell script

I am looking for HTML code that browse text file and grep with database file then retrieve result txtfileuploaded contain 112233 115599 113366 shell code grep -F -f txtfileuploaded /data/database.txt result 112233 Mar 41$ 115599 Nov 44$ 113366 Oct 33$ attached... (2 Replies)
Discussion started by: phpshell
2 Replies

5. Shell Programming and Scripting

problem with sending mail from txt file having HTML code via sendmail -t

Hi, i have the following code in shell named as test3.sh.. #!/bin/sh . /home/<user>/.profile export dt=`date "+%d%b%y"` export tim=`date "+%d%b%y %HM:%MM"` cd export WD=`pwd` SID="<sid>" export SID export ORACLE_SID=$SID export ORACLE_HOME=/oracle/$SID/102_64 export... (4 Replies)
Discussion started by: jassi10781
4 Replies

6. Shell Programming and Scripting

Adding incomplete HTML code to a file

Hi folks, I am scraping data from the Internet that has the format similar to what's on this page -- Trigger Notice Report The code I've written for scraping and storing results works fine when the HTML code is well written, but not when there are mistakes. In particular, the code breaks when... (4 Replies)
Discussion started by: ksk
4 Replies

7. Shell Programming and Scripting

mailing problem in unix

I have a mailing problem in UNIX.... MAILT="$1" MAILTO=`echo $MAILT | tr ';' ','` CONTENT="/var/www/html/notifier/mailnotify_ccdb.html" SUBJECT="$2" CC="man@abc.com" BCC="ant@abc.com" ( echo "To : ${MAILTO}" echo "Cc : ${CC}" echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" ... (3 Replies)
Discussion started by: rdhanek
3 Replies

8. Shell Programming and Scripting

HTML mailing

Hi All, I have a comma separated file as below. file-1 ---------- a,b,c d,e,f g,h,i . . . I want to send the above file in Mail in HTML format with all the values of each column in separate cells i.e. the body of the mail should be in tabular format & each field should be separate... (2 Replies)
Discussion started by: 46019
2 Replies

9. Shell Programming and Scripting

html problem: get file name dialog exists?

Hello, I wonder whether if we have a open file dialog as (in gtk+) in html. I know that a submit-type form (such as <input value="Add File" type="submit">) opens such dialog, but it -naturally- tries to submit the file chosen. I only want to find out the file name, not upload it. Thanks! (0 Replies)
Discussion started by: f33ldead
0 Replies

10. Shell Programming and Scripting

Mailing Problem

I have a Unix server with SunOS 5.8 installed on it. I have set a cron job which will send mail across the two different networks. As of now i can only send mails to the abc.com who owns the server but would also like to send it to xyz.com is there any setting or parameter wherein i need to add... (2 Replies)
Discussion started by: nimish
2 Replies
Login or Register to Ask a Question