On Wed, 9 Oct 2002 20:43:13 +0200, [EMAIL PROTECTED] (Octavian Rasnita)
wrote:

>Hello all,
>
>Could you please tell me what module should I use to send HTML mail?
>Can I use Net::SMTP?
>
>And what module could I use to send attachments

Here's a nice method for sending text and html at the same time.
That way, people without html mail readers can read it also.
You could easily add an attachment to this, before the end boundary.
##########################################################3
#!/usr/bin/perl
use Mail::Sendmail;
use strict;

my ($boundary,$html_email,$text_email,%email);

$boundary = 'qwerqwerqewrqwesdsad' . time;

$html_email = qq(<html>
<head><title>Email</title></head>
<body>
Hello world!
</body>
</html>
);

$text_email = qq(Hello world!\n);

%email = (   To => 'zentara@zentara',
>From            => 'zentara@zentara',
Subject         => 'Hello world',
'MIME-Version'  =>  1.0,
'Content-type'  =>  "multipart/alternative; boundary=$boundary",
Message =>
qq(--$boundary
Content-type: text/plain; charset=UNKNOWN-8BIT

$text_email
--$boundary
Content-type: text/html; charset=iso-8859-1

$html_email
--$boundary--
)
);

sendmail(%email);



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to