HTML Report from mail in ksh 88


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HTML Report from mail in ksh 88
# 1  
Old 01-28-2014
HTML Report from mail in ksh 88

Hi Team,
I'm trying to send HTML Report from email using the below script (Using ksh 88 version)
Code:
#!/bin/ksh
set -x
SUB="Test Email"
Mail_Body="This is for testing"
Send_Mail_HTML()
{
        (
         echo "FROM: abcd@test.com"
         echo "To: abcd@test.com"
         echo "Subject: $SUB"
         echo "MIME-Version: 1.0"
         echo "Content-Type: text/html"
         echo "Content-Disposition: inline"
         cat "$Mail_Body"
        ) | /usr/sbin/sendmail -t
}
##################Main Script Block############
Send_Mail_HTML

I'm getting the below error
Code:
$ ksh test_mail.sh
+ SUB=Test Email
+ Mail_Body=This is for testing
+ Send_Mail_HTML
cat: cannot open This is for testing

Please help me out with this ..
# 2  
Old 01-28-2014
Presumably because the file This is for testing does not exist.

Either create it, or (if you just want the contents of the variable Mail_body) change the cat to an echo.
# 3  
Old 01-28-2014
Might it have anything to do with the fact that your trying to use spaces in your filename?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

i am working on migration project, 8.5 sever able to embedded HTML report to mail body with below sy

i am working on migration project, 8.5 sever able to embedded HTML report to mail body with below syntax. $ mail -s "subject "recipient mail -- -f sender mail < xyz.html But above syntax is not working in 11.5 server and changed to below. $ mail -s "subject" -r recipient mail sender mail <... (0 Replies)
Discussion started by: JatinInfy
0 Replies

2. Shell Programming and Scripting

HTML mail with Attachment

Hi, I am using the below code: #!/bin/ksh SUBJ="Send mail from Unix with file attachments" TO=sudha.viswanathan@jpmorgan.com CC=sudha.viswanathan@jpmorgan.com ( cat << ! To : ${TO} Subject : ${SUBJ} Cc : ${CC} ! cat << ! MIME-Version: 1.0 Content-Type: text/html `cat... (1 Reply)
Discussion started by: sudvishw
1 Replies

3. Shell Programming and Scripting

Need help in sending html mail with attachment

Hi Everyone, I am facing problems in sending html mail with attachemnt. I will able to send mail with attachment (plain text ) using mailx -s and uuencode command and also html mail without attachment using sendmail option. However I am not able to send html mail along with attachment.Either... (2 Replies)
Discussion started by: karthik adiga
2 Replies

4. Shell Programming and Scripting

How to mail a html file.?

Hi, Can anyone tell me how to mail a html file in unix? I have a HTML file which contains a table structure, and i want this table to be created in the mail body and mail it. Does anyone have any suggestions. (3 Replies)
Discussion started by: rocky88
3 Replies

5. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

6. UNIX for Advanced & Expert Users

Mail x to HTML

Hi, i've build a script, 1: neon_script and the other 2:neon_mailing those to scripts i run with 3:neon_handmatig After that i get a mail in plain text in my mail box and i want it in html format. I already tried already a several things but nothings seems to work. Somebody got i idea how... (3 Replies)
Discussion started by: Rensen
3 Replies

7. Shell Programming and Scripting

how to Invoke html in ksh Script

how to invoke html file from a ksh shell plz help......... (4 Replies)
Discussion started by: ali560045
4 Replies

8. Shell Programming and Scripting

how to view html in ksh programm

have a script in ksh called file1 #!/bin/ksh cat my.html --------------------------- and a html file hy.html can u tell me that if i execute "file1" script it will open hy.html bt here it is showing the all the tags along with text......... it should open the browser part... (2 Replies)
Discussion started by: ali560045
2 Replies

9. Shell Programming and Scripting

mail: html content

hi guys, am required to prepare a report and mail it, to make it more appealing :p i wish to have content of mail in rich text format i.e html type with mailx how to specify the content type of mail body as html? Thanks in advance!!! rishi (2 Replies)
Discussion started by: RishiPahuja
2 Replies

10. UNIX for Dummies Questions & Answers

Using mail to send HTML emails

Hi, I'm a programmer not a sys admin, so please excuse this if it seems a little out of place, but I think it applies to this forum. When I send my HTML newsletter from the server it comes in as plain text on some email programs and not others. Eudora is fine; Outlook Express, Hotmail, and... (2 Replies)
Discussion started by: dmennis
2 Replies
Login or Register to Ask a Question