email html format

How can I send the HTML format in the email?
jpchenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KennyIT Application ExecutiveCommented:
Use MS Outlook and choose "always send to this recipient in rich text format".

I think Outlook express also can do it.
0
maxkirCommented:

This function works for most UNIX systems:


############################################################
# Sending mail function
# Parameters:
#  send_mail( recipient, mail from, subject, message content);
############################################################
sub send_mail()
{
   local($to, $from, $subj, $html_content) = @_;

   open(MAIL,"|/usr/lib/sendmail -t");

   print MAIL "To: $to\n";
   print MAIL "From: $from\n";
   print MAIL "Content-type: text/html\n";
   print MAIL "Subject: $subj\n\n";

   print MAIL "$html_content";

   close (MAIL);
}
0
guadalupeCommented:
I had this problem recently and my solution although containing a few extra steps was the best I came up with.

First write the email in a HTML able mail prog such as Outlook Express.  Send it to another HTML able mail prog.

Then use the prog to view the source of the message (Not the message but the real source with mail headers and all)

In Outlook the steps are:
File->Properties->Details->Message Source

Copy the source and paste it into the code below:

#!/usr/local/bin/perl
#
# Send message with SMTP.
#
use Net::SMTP;

#PLACE HOST WITH SMTP SERVER HERE
$hostname = "HOST NAME WITH SMTP";

#PLACE ADDRESS TO SEND TO HERE REMEMBER TO USE SINGLE QUOTES BECAUSE OF THE @
$address ='ADRESS';

#PLACE FROM ADDRESS HERE REMEMBER TO USE SINGLE QUOTES BECAUSE OF THE @
$from_address = 'FROM';
#
# Connect to SMTP server.
#
$mailserv = new Net::SMTP($hostname, Debug => 1,);
#
# Format message.
#
$data = <<END;

#Source as copied from mail prog

END
#
# Send the message.
#
$mailserv->mail( $from_address );
$mailserv->to( $address );
$mailserv->data( $data );
#
# Close connection.
$mailserv->quit();

# smtp.pl
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
guadalupeCommented:
To finish, I this necessary because, as you will notice, the source in the end is not just simple html  Links, Sources, Accents and many other things have their own little oddities like the '3D' for links.  I have yet to find a modual that does the coding for you and sendmail doesn't seem to do it either so... here's the long answer.  Just reject it if you find something simpler that works (and let me know for the next time).
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.