|
#1
|
||||
|
||||
|
Hello all,
I am used to working in with ASP, not PhP so I have a simple question... How do I have SendMail send an email to two email addresses? with ASP, it was a simple comma in between two emails. I tried this with PhP and it won't work. I also tried a semicolon with no luck. If it isn't possible, can you have a default domain mail sent to two email addresses? thanks |
|
#3
|
||||
|
||||
|
According to that, it just needs a comma, but that didn't work
|
|
#4
|
|||
|
|||
|
Hm, could you post a specific example of the code that is failing for you?
Typically when I send to multiple recipients or have a more complex email I use the custome headers parameter and just do any 'To' and 'CC' headers manually, but using commas in the variable for the 'to' parameter should work. |
|
#5
|
||||
|
||||
|
Well, I got it to work
![]() Basically, I just had to repeat the code with a second email address, such as: mail("someone@gmail.com", $subject, $message, $from); mail("somebody@hotmail.com", $subject, $message, $from);
|
|
#6
|
||||
|
||||
|
Quote:
|
|
#7
|
||||
|
||||
|
What is the -f parm? (parameter?)
|
|
#8
|
|||
|
|||
|
"$RAND_USER says use $RAND_PARAM!"
Check out the mail() doc page and scroll down to additional_parameters (optional) subheader under the Parameters header. Here's an explination from the sendmail() man page: Quote:
Quote:
|
|
#9
|
||||
|
||||
|
So, are you saying that the -f is the from? And that I should have a default from address?
The code I am using is grabbing the from address from the form. Here is the code for sending the form: <?php if(!$email == "" && (!strstr($email,"@") || !strstr($email,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; } if(empty($name) || empty($email) || empty($phone) || empty($comments )) { echo "<h2>Use Back - fill in all fields</h2>\n"; } echo $badinput; $todayis = date("l, F j, Y, g:i a") ; $subject == 'Contact Form'; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Attention: whoever \n Message: $comments \n From: $name ($email)\n Additional Info : IP = $ip \n Browser Info: $httpagent \n Referral : $httpref \n "; $from = "From: $email\r\n"; mail("somebody@gmail.com", $subject, $message, $from); ?> <p align="center"> Date: <?php echo $todayis ?> <br /> Thank You : <?php echo $name ?> ( <?php echo $email ?> ) <br /> Attention: whoever <br /> Message:<br /> <?php $notesout = str_replace("\r", "<br/>", $comments); echo $notesout; ?> <br /> <?php echo $ip ?> <br /><br /> </p> |
|
#10
|
||||
|
||||
|
This is how I do it, change your variable to suit.
Code:
$f="-f";
$returnpath = "webmaster@yourserver.com";
mail("somebody@gmail.com", $subject, $message, "$f$returnpath");
|
|
#11
|
||||
|
||||
|
OK, now my question is, if I am receiving the emails without the -f parm, why else would I need it?
|
|
#12
|
||||
|
||||
|
Quote:
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 05:21 AM.









