From: <[EMAIL PROTECTED]>
> Hi All,
> 
> I'm using perl module MIME::Lite to sent out email with attachments,
> may I know what "Type" should I define to attach any type of files,
> for instance .jpg, .xls, .doc, .pdf  and etc without checking the
> attached file type. Is there any global variable to define instead of
> Type => 'application/zip', Type => 'image/gif', Type => "application/
> xls" and etc?

You could use
Mail::Builder
to create the mail messages and and Email::Send to send them.

You should use something like:

use strict;
use warnings;
use Mail::Builder;
use Email::Send;

my $mail = Mail::Builder->new;
$mail->from('[EMAIL PROTECTED]');
$mail->to('[EMAIL PROTECTED]');
$mail->subject('Here is the subject');
$mail->plaintext('The plain text version');
$mail->htmltext('<b>The html</b> version');
$mail->attachment->add('file.pdf');
$mail->attachment->add('anotherfile.pdf');
$mail->image->add(image.jpg'); #An image you want to appear in the html file

my $mailer = Email::Send->new({mailer => 'SMTP'});
$mailer->mailer_args([Host => 'smtp.yourhost.com']);
$mailer->send($mail->stringify);

This module also encodes the headers as UTF-8, so they will be set correctly if 
the headers use special chars from other languages than english.
HTH.

Octavian


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to