facebook twitter youtube
in Tools - 08 Jul, 2010, This Tutorial Has Been Viewed 17,085 Times.
by admin - one comment
Send Email to Multiple Persons using php
VN:F [1.9.22_1171]
Rating: 8.1/10 (9 votes cast)

You can send email to mutiple persons at one shot using php. When you submit, this file will be sent an email immediately to the target emails from your database.

First create a DB

Database “mail” and table “email_list” with 3 fields: id(auto_increment), name(varchar, 50), email (varchar, 50) and put some records into this table.

< ?php
// Check, if submitted.

// Get variables from POST method form.

$sender="admin@yourdomain.ext"; // Your Email here.

echo "Email has been sent to:";

// Connect database

$rs=mysql_query("select * from email_list order by id asc");

// Do while loop to send email.
$mail_from="From:$email n";
$mail_from .="Content-Type: text/html; charset=utf-8 n";


// Show sent emails.
echo "$row[email]<br>";

// Do following codes if not found "Submit" value.(Not submitted) 
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>Email Form</title>
<form action="<? echo $PHP_SELF; ?>" method="post" name="form" id="form">
<td align="right">Subject : </td>
<td><input name="email" type="text" id="email" /></td>
<td align="right" valign="top">Note : </td>
<td><textarea name="comment" cols="60" rows="5" id="comment"></textarea></td>
<input type="submit" name="Submit" value="Send Email" />
< ? } ?>
VN:F [1.9.22_1171]
Rating: 8.1/10 (9 votes cast)
Send Email to Multiple Persons using php, 8.1 out of 10 based on 9 ratings

Incoming search terms:

coded by nessus

Leave a Reply

  • //19 May 2011

    I am a complete novice. The source code looks like it is for multiple pages. Which part goes where?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
Please support the site
By clicking any of these buttons you help our site to get better