Unix/Linux Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

unix and linux operating commands

unable to sent mail in html format by mailx command.

UNIX for Advanced & Expert Users


Tags
sendmail

Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 06-08-2004   -   Original Discussion by p_prathaban
p_prathaban's Unix or Linux Image
p_prathaban p_prathaban is offline
Registered User
 
Join Date: Feb 2004
Last Activity: 18 October 2004, 2:28 AM EDT
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Unix or Linux 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.
Sponsored Links
    #2  
Old Unix and Linux 06-08-2004   -   Original Discussion by p_prathaban
Ygor's Unix or Linux Image
Ygor Ygor is offline Forum Advisor  
Advisor
 
Join Date: Oct 2003
Last Activity: 15 May 2015, 11:55 AM EDT
Location: 54.23, -4.53
Posts: 1,801
Thanks: 1
Thanked 115 Times in 100 Posts
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

Sponsored Links
    #3  
Old Unix and Linux 06-08-2004   -   Original Discussion by p_prathaban
p_prathaban's Unix or Linux Image
p_prathaban p_prathaban is offline
Registered User
 
Join Date: Feb 2004
Last Activity: 18 October 2004, 2:28 AM EDT
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
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  
Old Unix and Linux 06-08-2004   -   Original Discussion by p_prathaban
Ygor's Unix or Linux Image
Ygor Ygor is offline Forum Advisor  
Advisor
 
Join Date: Oct 2003
Last Activity: 15 May 2015, 11:55 AM EDT
Location: 54.23, -4.53
Posts: 1,801
Thanks: 1
Thanked 115 Times in 100 Posts
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.
Sponsored Links
    #5  
Old Unix and Linux 06-10-2004   -   Original Discussion by p_prathaban
p_prathaban's Unix or Linux Image
p_prathaban p_prathaban is offline
Registered User
 
Join Date: Feb 2004
Last Activity: 18 October 2004, 2:28 AM EDT
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
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).
Sponsored Links
    #6  
Old Unix and Linux 06-10-2004   -   Original Discussion by p_prathaban
Ygor's Unix or Linux Image
Ygor Ygor is offline Forum Advisor  
Advisor
 
Join Date: Oct 2003
Last Activity: 15 May 2015, 11:55 AM EDT
Location: 54.23, -4.53
Posts: 1,801
Thanks: 1
Thanked 115 Times in 100 Posts
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"
The Following User Says Thank You to Ygor For This Useful Post:
parpaa (09-11-2013)
Sponsored Links
    #7  
Old Unix and Linux 05-09-2006   -   Original Discussion by p_prathaban
Nilesh Raul's Unix or Linux Image
Nilesh Raul Nilesh Raul is offline
Registered User
 
Join Date: May 2006
Last Activity: 14 August 2006, 7:28 AM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
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
Sponsored Links
Closed


Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to send mail through mailx Srinathkiru Solaris 0 04-17-2012 11:29 PM
Unable to send mail with inline html along with attachment. Please help! thulasidharan2k Shell Programming and Scripting 1 05-27-2011 09:19 AM
How would i mail in html format?(Formatting Help) pinga123 UNIX for Dummies Questions & Answers 0 04-14-2011 05:59 AM
How to embed a html file in a mail sending from Linux box with uuencode or mailx? johnveslin Shell Programming and Scripting 2 09-27-2010 07:16 PM
Unable to send e-mail using mailx command manas6 UNIX for Dummies Questions & Answers 1 01-22-2009 04:53 AM



All times are GMT -4. The time now is 04:37 PM.