Net::SMTP 
Author Message
 Net::SMTP

I am having trouble getting Net::SMTP to recognize that the content of the
message I am sending is text/html.

I have tried
$smtp->datasend("Content-Type: text/html;charset=iso-8859-1;");

however the message is always sent as text/plain, even if I specify
multipart/mixed, or encode it.

Specifying the content-type as text/html works with sendmail, but not with
Net::SMTP.  I need a solution that will work on both NT and Unix.

Sending the file as an attachment is not acceptable in this case.  Can
anyone help?



Sat, 19 Oct 2002 03:00:00 GMT  
 Net::SMTP

Quote:
> I am having trouble getting Net::SMTP to recognize that the content of
> the message I am sending is text/html.

> I have tried
> $smtp->datasend("Content-Type: text/html;charset=iso-8859-1;");

> however the message is always sent as text/plain, even if I specify
> multipart/mixed, or encode it.

FWIW, unless Net::SMTP is doing something magical that isn't documented,
your issue is not that Net::SMTP is wrong, but that the MIME headers in
your mail are wrong.

To make a MIME-aware mail reader work, you need a mime version header as
well as the content type header. Check the MIME RFCs to see exactly what
should go in there, but adding the following should work, I think:

$smtp->datasend("MIME-Version: 1.0");

        Daniel

--
You want to be famous and rich and happy, but you're terrified you have
nothing to offer this world. Nothing to say and no way to say it, but you can
say it in three languages.
        -- KMFDF, _Dogma_



Sun, 20 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Cannot get authenticated to Yahoo's SMTP servers while sending mail using Net::SMTP

2. SMTP problems with Net::SMTP using WinPerl/WinNT

3. SMTP without Net::Smtp

4. SMTP problems with Net::SMTP using WinPerl/WinNT

5. Help... have problems with 'too many symbols'

6. CGI Std Output and Input -- Please Help

7. API-type interrupt handlers in TP6

8. Net::SMTP and Net::Cmd datasend() problem

9. Help for Net::FTP and Net::SMTP

10. NET::Domain NET::SMTP

11. Net::SMTP and Net::Cmd datasend() problem

12. ANNOUNCE: Net::Domain, Net::SMTP, MailTools

 

 
Powered by phpBB® Forum Software