Jump to content

Recommended Posts

<?php
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$dropdown = $_POST['dropdown'];
$formcontent=" From: $firstname \n Surname: $lastname \n Email: $email \n Dropdown: $dropdown";
$recipient = "[email protected], [email protected]";
$subject = "Newsletter Sign Up";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
if ( mail($recipient, $subject, $formcontent, $mailheader) ){
header('Location: http://www.sittingspiritually.co.uk/thankyou.php');
} else {
die ("error");
}
?>

 

I have recently created a small snippet of php code for posting mail and it's sweet apart from 1 thing.

 

I have two email addresses in the recipient section. It only sends to the last name in the list.

 

Is this because i have written recipient? Should it be recipients?

 

I need this mail to be delivered to both of the email addresses.

 

I'm sure it's simple for someone with expert knowledge.

 

Thanks in advance for any help.

 

OK.

 

When I tested it with two of my own email addresses it worked perfectly.

 

I think it could be a problem with one of the email addresses.

 

I'll try using another email address in it's place to see if that's the problem.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.