PDA

View Full Version : Multipls e mail addresses in php form


fwr1000
03-26-2007, 08:10 PM
Using the script from DW Club tut to send e mail from a form submit. Works great. I would like to add a second e mail address for the form results to be sent to.

Do I add the second address to this line and if so, what is the seperator, comma , semi colon ; ??

PHP Code:

// Your email address. This is where the form information will be sent.
$emailadd = 'abcsample@yahoo.com';

If this is not the right way, would appreciate how to add the second address (if possible).

thnx
Fred

fwr1000
03-31-2007, 07:50 PM
Bump.

I've tried experimenting with separating the addresses with a comma on the same line, adding a second line of code with the second address but neither works. It just sends to one address and not necessarily the first one.

Any ideas?

Here's the two line code:

// Your email address. This is where the form information will be sent.
$emailadd = 'fwr1000@earthlink.net';
$emailadd = 'fwr1000@charter.net';

here's the one line code I tried

// Your email address. This is where the form information will be sent.
$emailadd = 'fwr1000@earthlink.net','fwr1000@charter.net';

Note I got an error message when using a semi colon in the one line method.

thanks for any help

davidj
03-31-2007, 08:46 PM
try this..

$emailadd = 'fwr1000@earthlink.net\n' ;
$emailadd .= 'fwr1000@charter.net\n';

fwr1000
03-31-2007, 10:15 PM
I knew you were lurking out there somewhere davidj. Thanks for the help. One quick question, is there supposed to be a "." period on the second line just before the = sign? Not sure if this was correct or a slip of the typing finger. Just wanted to make sure befoe I set it up.

Thanks again
Fred

davidj
03-31-2007, 10:20 PM
its a concatenation method for adding to a var


$var = "a";
$var .= "b";
$var .= "c";


this is valid and will output abc when you echo $var