{ 7 comments… read them below or add one }

1 Frank Wiles June 12, 2007 at 8:33 pm

If you’re interested in sending HTML emails from Perl you might want to check out an article I wrote on MIME::Lite::TT and MIME::Lite::TT::HTML for sending Emails.

By using the MIME::Lite::TT and/or MIME::Lite:TT::HTML modules you can take advantage of both the features of MIME::Lite, but also add in the ability to use Template Toolkit templates for your text/plain and text/html parts.

Hope it helps!

Reply

2 Theunis May 24, 2009 at 8:26 pm

Thanks Frank. Great tuturial.

Reply

3 Mike August 17, 2009 at 5:24 am

Hi , I have a problem when I send a long string used Data=>$content, $content included \r\n , It can not sent all the content of $content . could you please tell me what the problem is ?

Reply

4 vankinh January 29, 2010 at 3:01 pm

test sendmail in linux.

Reply

5 Srini May 29, 2011 at 7:15 pm

This helps me a lot and I am really thankfull

Reply

6 sanuda March 23, 2012 at 1:12 am

Really helpful for me as a Perl Developer . Thanks a lot for your article

Reply

7 Jan May 16, 2012 at 1:35 pm

Hi,
I’ve got this error message:
SMTP Failed to connect to mail server: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
at C:/EclipseWorkspaces/csse120/Perl_testy/Tk_hello_world.pl line 29

Here is code:

use MIME::Lite;
$user = 'aocmct@gmail.com';
$pass = 'xxxxxxxxxx';
print "$user\n";
print "$pass\n";
MIME::Lite->send('smtp', 'smtp.gmail.com',
	AuthUser=>$user, AuthPass=>$pass, Timeout=>10);
# AuthUser=>$user, AuthPass=>$pass);
my $MailFrom = 'aocmct@gmail.com';
my $to_list  = 'jan.vicher@yahoo.com';
my $cc_list  = 'ice809@seznam.cz';
my $subject  = "hello test";
my $message  = "This email was generated automatically.";
my $msg = MIME::Lite->new(
    From     => $MailFrom,
    To       => $to_list,
    Cc       => $cc_list,
    Subject  => $subject,
    Type     => 'TEXT',
    Encoding => '7bit',
    Data     => $message,
);
print "I\'m sending message\.\.\.\n";
print $msg;
$msg->send();

Could you help me please?

Jan

Reply

Leave a Comment

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: