Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Mailer Question



3:31 am on Jun 15, 2005 (gmt 0)

10+ Year Member

My book is using an example with the Mail::Sendmail module being used. Unfortunately my host does not have this module available. I do however have access to the Mail::Mailer. The problem is that I am on a deadline of midnight Wednesday June 15 and I do not understand any of the online documentation. Can someone give me a quick instruct on how to send mail with the Mail::Mailer module. I would greatly appreciate it.


7:47 am on Jun 15, 2005 (gmt 0)

Perl modules usually have the documentation with them, right in the code. You can get at it by:

perldoc Mail::Mailer

You can also view in via cpan.org:




10:41 pm on Jun 15, 2005 (gmt 0)

10+ Year Member

wdr, I read that but it is greek to me. Can you please break it down for me. What I need to do is to have the script save the contents to a database, then send out an email to the person that submitted the form.


2:32 pm on Jun 16, 2005 (gmt 0)

10+ Year Member

This works for me to a test file. It dies on my Windows box when I try to use smtp due to a fork. If you are on a unix box with sendmail, I bet that would work.


use strict;
use warnings;
use Carp;
use Mail::Mailer;

# pick one
# my $type = "sendmail";
# my $type = "smtp";
# my $type = "qmail";
my $type = "testfile";

my $mailer = new Mail::Mailer $type;

my %headers = ();

$headers {From} = 'you@yourdomeain.com';
$headers {To} = 'them@theirdomain.com';
$headers {CC} = 'other@otherdomain.com';
$headers {BCC} = 'more@moredomain.com';


my $body = "This is the body of the email";

print $mailer $body;


Featured Threads

Hot Threads This Week

Hot Threads This Month