homepage Welcome to WebmasterWorld Guest from 54.166.66.204
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
Mailer Question
gnotellaluvr




msg:443194
 3:31 am on Jun 15, 2005 (gmt 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.

 

wdr1




msg:443195
 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:

[search.cpan.org...]

HTH,
-Bill

gnotellaluvr




msg:443196
 10:41 pm on Jun 15, 2005 (gmt 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.

wruppert




msg:443197
 2:32 pm on Jun 16, 2005 (gmt 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]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved