I send email to multiple recipients using below code but its has problem. First i have to set all emails on php code ($to="email,email,email more"). Then i can send them email.
I wants a text area box () for paste my all email/email list and send them. I don't want to add email one by one on php code.
This is my Code:
<?php
$to = $_POST['email_list']; //i'm trying this but not working.
//$to = "xyz@somedomain.com".","."xyz1@somedomain.com".","."xyz2@somedomain.com";
$subject = $_POST['subject'];
$message = $_POST['message'];
$header = "From:abc@somedomain.com \r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}
?>
<textarea type="text" name="email_list"></textarea><br/>
<input type="text" name="subject"/><br/>
<textarea type="text" name="message"></textarea><br/>
<input type="submit" name="submit" value="Submit"/>