Emailing web form to autoresponder

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jay@kimble-kennedy.com
Forum Newbie
Posts: 4
Joined: Fri Jan 23, 2004 5:04 pm

Emailing web form to autoresponder

Post by jay@kimble-kennedy.com »

hey all!! New to the forum.

right off the bat, I have what is a simple question for you guys.

I need to change the following code to change the php code from emailing just the admin to also our autoresponder, and add the word subscribe to the subject of the email.
currently, it looks like this.


/* the site administrator's email address */

$adminaddress = "admin@ourwebsite.com";



// we are now going to email them there info

mail("$adminaddress",


"subject goes here",

"subject goes here\n

Access Code: $accesscode\n

Clients Dir: $id_num\n

First Name: $firstname\n

Last Name: $lastname\n

Im already extremely appreciative in advance, thanks guys!
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

You might be able to put two email addresses in the $adminaddress variable (renaming it of course). A definitely working method would be to just call mail() twice - once with each address. When do you want "subscribe" added to the email, on this script or by the autoresponder? If it's here, then just put the subject into a variable, and in the email sent to the autoresponder, just do the following : $subject_variable = $subject_variable." subscribe".
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

To send the mail to more then one person just do this:

Code: Select all

<?php
$adminaddress = "admin@ourwebsite.com, autoresponder@ourwebsite.com"; 
?>
jay@kimble-kennedy.com
Forum Newbie
Posts: 4
Joined: Fri Jan 23, 2004 5:04 pm

Post by jay@kimble-kennedy.com »

I think that worked , Duff.

THANK YOU Very much!!
Post Reply