Gossamer Forum
Home : General : Perl Programming :

HTML Mail

Quote Reply
HTML Mail
Is there a way to format Mailer.pm to send mail in HTML format, or in the alternative, how actually do you go about sending HTML formatted mail?
Quote Reply
Re: HTML Mail In reply to
Check out one of the recent Threads in the Forum that provides codes for doing this.

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: HTML Mail In reply to
Thanks Eliot:

That was a big help! Don't know why I couldn't find that thread when I searched. Again, thanks.
Quote Reply
Re: HTML Mail In reply to
Thanks Eliot:

I have searched for "html" and "mail" and the results turn up nothing that answers my question. Perhaps I was unclear with what I meant. I wish to send out email that is html formatted instead of text.

[This message has been edited by Lee (edited December 16, 1999).]
Quote Reply
Re: HTML Mail In reply to
Go here:

http://www.gossamer-threads.com/scripts/forum/resources/Forum8/HTML/000921.html

You can use the codes in it within your SMTP routines you have in your scripts.

Wink

Regards.

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: HTML Mail In reply to
OK, I took the information provided in the threads and gave it a shot ... to no avail.

Here is my code:

open (MAIL, "|$mailprog -t")
| | print "Can't start mail program";
print MAIL "To: $name\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: text/html; charset=us-ascii\n";
print MAIL "Content-Transfer-Encoding: 7bit\n";
print MAIL "Content-Disposition: inline; filename=newsletter.html\n";
print MAIL "Content-Base: http\:\/\/www.mydomain.com\/data\/newsletter\/\n";

close (MAIL);

Can anyone tell what I am doing wrong? I know the mail program is configured properly because text files get sent with no problem.

Thanks for your help. Merry Christmas!
Quote Reply
Re: HTML Mail In reply to
Change the following codes:

Code:
open (MAIL, "|$mailprog -t")

TO THE FOLLOWING:

Code:
open (MAIL, "$mailprog")

Then in your $mailprog variable, use the following:

Code:
$mailprog = "|/usr/local/bin/sendmail -t -oeq";

You may have to change the sendmail path to what you have on your server.

Also, the codes you have are for SENDMAIL not SMTP or Sockets that the Mailer.pm uses. You need to have SENDMAIL program on your server for the codes you have posted to use.

Hope this helps.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: HTML Mail In reply to
It appears that people are having trouble understanding what is going on here. It is my fault. Here is the code to make this work. I only displayed the header info, and not including the perl syntax.

Code:
$mailprog = "/path/to/sendmail";
open(MAIL, "|$mailprog -t -oeq") | | die "Can't open $mailprog!";
print MAIL "From: Your Name<you@YourDomain.com>\n";
print MAIL "To: Recipient Name <them@Theirs.com>\n";
print MAIL "Subject: test message\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: text/html; charset=us-ascii\n";
print MAIL "Content-Transfer-Encoding: 7bit\n\n";

Hope that clears things up.

Regards



[This message has been edited by Chris071371 (edited January 03, 2000).]
Quote Reply
Re: HTML Mail In reply to
Thank you, Chris!
It worked perfectly for me!!
One question. How come you used 7bit encoding not 8?