CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
sending to multiple email addresses

 



douge
Deleted

May 2, 2000, 5:39 AM

Post #1 of 2 (607 views)
sending to multiple email addresses Can't Post

I'm using sendmail and can send to an individual address but I need to send to a group of multiple addresses. Like:

address1@home.com, address2@home.com, address3@home.com

What is the syntax for this? Is it possible?

Thanks in advance


perlkid
stranger

May 3, 2000, 9:47 AM

Post #2 of 2 (607 views)
Re: sending to multiple email addresses [In reply to] Can't Post

 
I'm sure it's possible, and I'll take a stab at the syntax.

if all of the addresses are in a data base the I would try this if the data is close to this;
perlkid@host.com|perlkid|
cure@thesavior.com|cure|
## first field email second name

$yourmail="yourmail\@host.com";
$mailprog="/usr/lib/sendmail";

open(email, "</home/html/database/email.db");
@all=<email>;
close(email);
foreach $line (@all)
{
@fields = split(/\|/, $line);
$theirname = ucfirst($fields[1]);
$mailprog="/usr/lib/sendmail";
$mailto = "$fields[0]";
open (MAIL, "| $mailprog -t -oi") &#0124; &#0124; die "Can't open $mailprog";
print MAIL "To: $mailto\n";
print MAIL "From: $yourmail\n";
print MAIL "Subject:Testing\n";
print MAIL "Welcome to this mailing list.\n";
}


The mail code may be a little off but it's just to give you an idea. Hope that works. Make sure to close the fields in the data base with a pipe or the code won't work.

perlkid

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives