[Nh-pm] Re: Nh-pm digest, Vol 1 #46 - 1 msg
Allen Barriere
allen at thirstyfishy.com
Tue Jun 10 13:39:34 CDT 2003
I've had a lot of luck with the Mailtools package --
fill in servers and addresses
#!perl -w
use Mail::Mailer;
my @maillist = ("me at here.com","you at there.com",)
my $body = "You're text here\n\nAllen";
sub email
{
print "sending mail...\n";
$from = "Whoever";
$subject="blah blah";
$type="smtp";
$server="mail.whereever.com";
foreach $address (@maillist)
{
my $mailer = Mail::Mailer->new($type, Server => $server);
$mailer->open({From => ${from},
To => $address,
Subject => $subject});
print $mailer $body;
$mailer->close;
}
print "mail sent.\n";
}
nh-pm-request at mail.pm.org writes:
> Send Nh-pm mailing list submissions to
> nh-pm at mail.pm.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mail.pm.org/mailman/listinfo/nh-pm
> or, via email, send a message with subject or body 'help' to
> nh-pm-request at mail.pm.org
>
> You can reach the person managing the list at
> nh-pm-admin at mail.pm.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Nh-pm digest..."
>
>
> Today's Topics:
>
> 1. Sending mail, setting From (pll at lanminds.com)
>
> --__--__--
>
> Message: 1
> Reply-To: pll at lanminds.com
> From: pll at lanminds.com
> To: nh-pm at mail.pm.org
> Date: Mon, 09 Jun 2003 13:00:16 -0400
> Subject: [Nh-pm] Sending mail, setting From
>
>
> Hi all,
>
> I'm trying to wrap my head around the Mail::Internet package, and not
> succeeding for some reason. I've figured out Mail::Send, but I need
> the From: header to be set to something other than the invoking
> user's e-mail address (since the invoking user will ultimately be a
> web form running as www-data, aka, apache :)
>
> Mail:Send for some reason doesn't allow you to set the From header.
> I've tried, and it seems to work, but when the mail is recieved, it
> doesn't have the From addr I set.
>
> Does anyone have a quick example of doing this with Mail::Internet or
> some other module?
>
> (I know I've done this in the past, but I don't seem to have that
> code here at work :(
>
> Thanks,
>
>
>
>
> --
>
> Seeya,
> Paul
> --
> Key fingerprint = 1660 FECC 5D21 D286 F853 E808 BB07 9239 53F1 28EE
>
> It may look like I'm just sitting here doing nothing,
> but I'm really actively waiting for all my problems to go away.
>
> If you're not having fun, you're not doing it right!
>
>
>
>
> --__--__--
>
> _______________________________________________
> Nh-pm mailing list
> Nh-pm at mail.pm.org
> http://mail.pm.org/mailman/listinfo/nh-pm
>
>
> End of Nh-pm Digest
More information about the Nh-pm
mailing list