-2

A client of mine has just asked me if it's possible to modify the following snippet to send an email to 2 different email addresses;

// Get Data 
$email = strip_tags($_POST['email']);

// Send Message
mail( "sampleemail@domain.com", "Holding page email submission",
"Email: $email",
"From: Hold Page <$email>" );

I didn't write the code so I'm not really sure how to do it.

Any ideas?

Dean Elliott
  • 727
  • 2
  • 13
  • 26
  • separate the mails with a coma? or calling the `mail()` with different id's twice if you don't want the users to get the email of other users in the list when they receive mails? – Mr. Alien Oct 22 '13 at 11:02
  • I strongly recommend using a decent mailer class for sending mails with PHP, such as PHPMailer or Swiftmailer. – Spudley Oct 22 '13 at 11:04
  • There are a ton of solutions to this, have a quick google and you'll find the answer in no time :) – Kyle Goslan Oct 22 '13 at 11:05

1 Answers1

0

PHP mail

The 'to' field takes Receiver, or receivers of the mail so you can provide two emails there.

vaibhavmande
  • 1,115
  • 9
  • 17