Welcome to WebmasterWorld Guest from 54.242.83.92

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Mailer Question

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

New User

10+ Year Member

joined:May 24, 2005
posts:12
votes: 0


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 June 15, 2005 (gmt 0)

New User

joined:July 3, 2004
posts:8
votes: 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:

[search.cpan.org...]

HTH,
-Bill

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

New User

10+ Year Member

joined:May 24, 2005
posts:12
votes: 0


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 June 16, 2005 (gmt 0)

Full Member

10+ Year Member

joined:July 23, 2003
posts:227
votes: 0


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.

[pre]
#!/usr/bin/perl

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';

$mailer->open(\%headers);

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

print $mailer $body;

$mailer->close;
[/pre]
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members