unable to sent mail in html format by mailx command.


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Question unable to sent mail in html format by mailx command.

I use maix command to sent mails.
i can sent only plain text mails.

Unable to sent mails in html format.
while sending mails in html format, the received mail has the html code only.
# 2  
I think that you will have to use sendmail instead of mailx to send inline html, e.g....
Code:
#!/usr/bin/ksh

export MAILTO="spam@ebay.com"
export CONTENT="filename.html"
export SUBJECT="Subject"
(
 echo "Subject: $SUBJECT"
 echo "MIME-Version: 1.0"
 echo "Content-Type: text/html"
 echo "Content-Disposition: inline"
 cat $CONTENT
) | /usr/sbin/sendmail $MAILTO

# 3  
thankx

it worked with sendmail..

when i tried the similiar way in mailx by

( echo "Content-Type: text/html"; cat <<filename.htm>>; ) | mailx -s 'xx' xx@x.com

it give the html source code insists of html formatted file.

Is that not possible to convert sendmail to maix ...?



In sendmail the from address can be change, but in mailx the from address remains the user login address, I need to do with mailx only.
# 4  
The mailx utility is a front-end for sendmail.

It is not possible to use mailx to send inline html, but you can attach html documents.
# 5  
Fine.

After sending the mail by SendMail,

when i saw the mail, the From address was there.
But the To Address is not there at the receipt end.

How to get the to address in the maix box and also the cc(if any).
# 6  
You should look at the manual pages for sendmail. I have only included the bare minimum to get you started. You can add headers like "To:", "Cc:", "Bcc:", "Apparently-To:", etc. This can be done manually or via the -O options, e.g. -O "NoRecipientAction=add-to"
This User Gave Thanks to Ygor For This Post:
# 7  
Hi All,

With sendmail command i am able to send HTML page as a body of mail but not able to attach PDF file as an attachment in the same mail...

Could u pls help me resolving this problem ....

Pls see the code which i am using ....

Rgds,
Nilesh

mailfrom="abcd@emirates.com"
mailto="xyz@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)> ./file1
uuencode $attachment $attachment|sendmail $mailto < ./file1
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Unable to attach a .txt file or .log file to mail and mailx command
Samah
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...... Shell Programming and Scripting
5
Shell Programming and Scripting
Mailx command - send mail as table format
qwertyu
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 ------ ...... Shell Programming and Scripting
2
Shell Programming and Scripting
Unable to send mail through mailx
Srinathkiru
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......... Solaris
0
Solaris
How to embed a html file in a mail sending from Linux box with uuencode or mailx?
johnveslin
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.... Shell Programming and Scripting
2
Shell Programming and Scripting
Unable to send e-mail using mailx command
manas6
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...... UNIX for Dummies Questions & Answers
1
UNIX for Dummies Questions & Answers