Autoresponder

They have: 8 posts

Joined: Oct 1999

Greetings:

I have aa script that gathers information from hte user, pokes that info into a mSQL database and then servers up a confirmation for the user. Currently, we do not request their email address, but will be adding that field. I do not know how to write an autoresponder that will mail the contents of their input back to them upon confirmation.

I would like to write an autoresponder that can accept an array of email addresses so that I can email the confirmation back to them and send it on to an administrator in my organization. Any advice, code, or resources that you know of are greatly appreciated.

Thanks

They have: 850 posts

Joined: Jul 1999

Try somthing like this:

code:

$mailprog = '/usr/lib/sendmail' ;

foreach $email (@emailarray)
{
open (MAIL, "|$mailprog -t");
print MAIL "To: $email\n";
print MAIL "Reply-to: your\@email.com\n";
print MAIL "From: your\@email.com\n";
print MAIL "Subject: $subject\n";
print MAIL "\n\n";
print MAIL "$main\n" ;
print MAIL "\n\n";
close (MAIL);
} # End Foreach $email

[/code]

That would email all the emails in @emailarray. The Subject would be in $subject, and content would be in $main.  You do need  SendMail installed on the system.

hope this helped.



------------------
You blink about 84,000,000 times per year. 

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.