unable to sent mail in html format by mailx command.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users unable to sent mail in html format by mailx command.
# 8  
Old 05-10-2006
Change the last two lines. From...
Code:
cat /trident1/applprod/erpprodappl/xxegfin/11.5.0/bin/$content)> ./file1
uuencode $attachment $attachment|sendmail $mailto < ./file1

...to...
Code:
cat /trident1/applprod/erpprodappl/xxegfin/11.5.0/bin/$content
uuencode $attachment $attachment ) | sendmail $mailto

# 9  
Old 05-10-2006
Hi,
Thanks for ur quick input....
We modified the script as u mentioned .... HTML file is coming (Opening) properly in email body but below mail body PDF file (Which we r sending as attachment) is opening as garbage characters...

Rgds,
Nilesh


mailfrom="S259210@emirates.com"
mailto="S339824@emirates.com"
content="XXEGAR_EK_SOA_Email.htm"
subject="EK SOA with send mail"
attachment="/trident1/applprod/erpprodcomn/feeders/ar_statement/out/DDP008_300905.zip"
cd /trident1/applprod/erpprodappl/xxegfin/11.5.0/bin
(echo "From: $mailfrom"
#echo "To: $mailto"
echo "subject: $subject"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
cat /trident1/applprod/erpprodappl/xxegfin/11.5.0/bin/$content
uuencode $attachment $attachment) | sendmail $mailto
# 10  
Old 05-11-2006
All I see in attachment is a zip file..
Code:
attachment="/trident1/applprod/erpprodcomn/feeders/ar_statement/out/DDP008_300905.zip"

is the pdf file zipped in this archive..? make sure your zip is not corrupt.. or try sending the pdf itself.. rather than zipping it..
# 11  
Old 05-13-2006
Hi Ambikesh,

Thanks for ur reply...

We r zipping a PDF files because some of the PDF files are more then 1 or 1.5 MBs and we are not able to send it by mail...
We checked, PDF file is not corrupted after zipping....

Rgds,
Nilesh
# 12  
Old 05-14-2006
Are you getting email with an attachment or the email itself shows some garbage characters..?
# 13  
Old 06-06-2006
Hi,

We got the solution for the sending PDF file as attachment and html as mail body from unix send mail...

I am able to open attached PDF file from my Hotmail, Yahoo id's but getting error in Gmail.com..
Error is "Adobe Reader could not open PDF file because it is either not a supported file type or because the file has been corrupted(for example, it was sent as an email attachment and wasn't correctly decoded ) "

thanks,
Nilesh

/***********Unix shell*****************************/

mailfrom=$1
#echo 'mailfrom :'$mailfrom
mailto=$2
#echo 'mailto :'$mailto
subject=$3
#echo 'subject :'$subject
content=$4
#echo 'content :'$content
attachment=$5
#echo 'attachment :'$attachment
Unixfile_Dir=$6
#echo 'Unixfile_Dir :'$Unixfile_Dir
sed_command=$7
echo 'sed_command :'$sed_command
file_name=$8
echo 'file_name :'$file_name

cd $Unixfile_Dir
(echo "MIME-Version: 1.0"
echo "From: Emirates Group Credit Control <$mailfrom>"
echo "To: $mailto"
echo "subject: $subject"
echo 'Content-Type: multipart/mixed; boundary="-"'
echo "---"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
)> XXEGHTMLFORMATFILE

(echo "---"
echo "Content-Type: application/octet-stream; name=$file_name"
echo "Content-Transfer-Encoding: x-uuencode"
echo "Content-Disposition: inline; filename=$file_name"
echo "---"
)> XXEGPDFFORMATFILE

cat $Unixfile_Dir$content | sed s/"$sed_command"/g > XXEGAR_EK_SOA_Email_NEW.htm

uuencode $attachment SOA_Attachment > SOA_Attachment

cat XXEGHTMLFORMATFILE XXEGAR_EK_SOA_Email_NEW.htm XXEGPDFFORMATFILE SOA_Attachment|sendmail $mailto
echo Done, mail sent.

/***********************************************/
# 14  
Old 08-14-2006
Sendmail Attachment

Hi Nilesh

I am trying to learn something from ur code. Me too have to send an HTML content as Message Body. I may also have attachment of any DOC type..eg .xls, .pdf, .rtf etc. though unlike u I do not have a .zip file as an attachment.

I tried to follow ur code and managed the following code:
Code:
FILE_NAME="test.xls"
(
echo "From:Amruta Pitkar"
echo "To:apkar@yahoo.com"
echo "Subject:Ebill Department Trial"
echo "Cc:uer@hotmail.com"
echo "MIME-Version: 1.0"
echo 'Content-Type:multipart/mixed; boundary="-"'
echo "-----"
echo "Content-Type:text/html"
echo "Content-Disposition:inline"
)>AHTMLFILE

(
echo "----"
echo "Content-Type:application/octet-stream;name=$FILE_NAME"
echo "Content-Transfer-Encoding:x-uuencode"
echo "Content-Disposition:inline;filename=$FILE_NAME"
echo "-----"
)>AXLSFILE

uuencode test.xls MyAttach > MyAttach
cat AHTMLFILE e28931.htm AXLSFILE MyAttach | sendmail apkar@yahoo.com
echo "Done mail sent"

But I dont see the message body, neither the Attachment.
Can u guide me so ?
Thanks
Amruta Pitkar

Last edited by Amruta Pitkar; 08-14-2006 at 06:52 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unable to attach a .txt file or .log file to mail and mailx command

Hi, I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed. Here is my... (5 Replies)
Discussion started by: Samah
5 Replies

2. UNIX for Dummies Questions & Answers

Unable to send attachment using mailx command

I am unable to send email with attachment using the mailx command. Without the attachment, the email goes through file. This is the command I use. Works : $ echo "Test" | mailx -s "Test" username@website.com Fails : $echo "Test" | mailx -a all-dss-accounts.txt -s "Test"... (3 Replies)
Discussion started by: nkarthik_mnnit
3 Replies

3. Shell Programming and Scripting

Not able to send the mail using mail and mailx command

Hi All, I am trying to send a mail from linux server but could'nt able to send the mail. I tried the below syntax's so far but no luck. mail -s “Hello world” abc@xyz.com < /usr/g/txt.log cat "txt.log" | mailx -s "Hello world" abc@xyz.com mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies

4. Shell Programming and Scripting

Mailx command - send mail as table format

I have to send a couple of rows that have been returned from a SQL query. I have written the output of the query to a file and while i try to print this in the mail body the formatting goes wrong. Intended Output in mail body: Col1 Col2 Col3 ------ ... (2 Replies)
Discussion started by: qwertyu
2 Replies

5. Solaris

Unable to send mail through mailx

Hi, I am using solaris 5.9 OS and I am facing an issues with mailx. My SMTP port is configured to listen 6190 and not the default one which is 25. I can send mail to my inbox when i do it manually through the following steps root@<dbname> # telnet 15.12.88.10 6190 Trying 15.12.88.10...... (0 Replies)
Discussion started by: Srinathkiru
0 Replies

6. Shell Programming and Scripting

Unable to send mail with inline html along with attachment. Please help!

The below code is not working. I am able to send only inline html or only attachment. When trying to do both, only inline html is sent without attachment. Please help! #!/bin/ksh (echo "Subject: Test Mail - HTML Format" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

7. UNIX for Dummies Questions & Answers

How would i mail in html format?(Formatting Help)

I have written a scripts that checks the load average of server and if it is more than 5 it send a mail describing Current Load Average and High CPU/RAM processes . The problem is I want to send these information in html form .I have done necessary coding to do the same but whenever i try to... (7 Replies)
Discussion started by: pinga123
7 Replies

8. UNIX for Dummies Questions & Answers

How would i mail in html format?(Formatting Help)

I have written a scripts that checks the load average of server and if it is more than 5 it send a mail describing Current Load Average and High CPU/RAM processes . The problem is I want to send these information in html form .I have done necessary coding to do the same but whenever i try to... (0 Replies)
Discussion started by: pinga123
0 Replies

9. Shell Programming and Scripting

How to embed a html file in a mail sending from Linux box with uuencode or mailx?

How to embed a html file as subject in a mail sending from Linux box with uuencode or mailx or any other way? we do not want the file as attachment, it should be embedded in the mail subject. (2 Replies)
Discussion started by: johnveslin
2 Replies

10. UNIX for Dummies Questions & Answers

Unable to send e-mail using mailx command

Hi All, Can you please help me in solving this. I am facing some problem sending mails. If I use like this, I am able to send mail the mail echo "This is an automated e-mail; please do not reply." | mailx -s "Good Morning ." 'abc@xys.com' But if I use like this, then I am unable to send... (1 Reply)
Discussion started by: manas6
1 Replies
Login or Register to Ask a Question