mardi 14 avril 2015

Send Email To Multiple (Each Line Email Address) and Print

I am not good at PHP but still trying to create a test script so that i can learn it. I am referring to w3schools and i don't know how good or bad i am. I need some changes to be made to what script i just created.



<?php

$to = $_POST['EmailList'];
$subject = $_POST['EmailSubject'];
$message = $_POST['EmailBody'];

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <admin@admin.com>' . "\r\n";

mail($to,$subject,$message,$headers);

print_r($headers)
?>

<html>
<center>
<form method="post">
<br><strong>PHP Email Sender</strong><br><br><br>

Email List<br>
<textarea name="EmailList" placeholder="email@email.com (New Email Each Line)" rows="20" cols="50"></textarea><br><br>

Subject<br>
<input type="text" name="EmailSubject" placeholder="Your Subject Goes Here"><br><br>

Body<br>
<textarea name="EmailBody" placeholder="Write your content (HTML Accepted)" rows="20" cols="50"></textarea><br><br>

<input type="submit" value="Submit!">
</form><br><br>

</center>
</html>



  1. I want some help so that i can send email's to different email's but each email would be in a different line and i would not be using a comma(,). I want the script to generate the comma(,) by its own and carry each email from a new line.

  2. For example i entered 10 emails i need each email to be printed and a message saying sent besides that.


Please let me know if this is possible. I just need some help.


Aucun commentaire:

Enregistrer un commentaire