< Buzzing or vibrating the login form using jquery Posted On May 15, 2012 : 0 comments << >> Simple div slideshow using jquery Posted On May 9, 2012 : 0 comments << >> Copy mysql column in varchar to type date Posted On May 3, 2012 : 0 comments << >> Enter only numbers inside a input field of a form using javascript Posted On May 1, 2012 : 0 comments << >> Slide in and out animate div vertically using jquery Posted On April 25, 2012 : 1 comment << >> Tag cloud using php, mysql and ajax with filter Posted On April 24, 2012 : 0 comments << >> Change webpage font color or background color from the user side using javascript Posted On April 19, 2012 : 0 comments << >> A single link that cycles through several webpage background color using javascript Posted On April 17, 2012 : 0 comments << >> Simple webpage redirection using perl script Posted On April 10, 2012 : 0 comments << >> Get ipaddress using perl script Posted On April 4, 2012 : 0 comments << >>

Send Email to Multiple Persons using php

This Tutorial Has Been Viewed 5,178 Times.
VN:F [1.9.17_1161]
Rating: 8.5/10 (4 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.
if($Submit){

// Get variables from POST method form.
$subject=$_POST['subject'];
$note=$_POST['note'];

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

echo "Email has been sent to:";

// Connect database
mysql_connect("localhost","","");
mysql_select_db("mail");

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

// Do while loop to send email.
while($row=mysql_fetch_assoc($rs)){
$to=$row['email'];
$mail_from="From:$email n";
$mail_from .="Content-Type: text/html; charset=utf-8 n";

mail($to,$subject,$note,$mail_from);

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

// Do following codes if not found "Submit" value.(Not submitted)
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<title>Email Form</title>
<body>
<form action="<? echo $PHP_SELF; ?>" method="post" name="form" id="form">
<table>
<tr>
<td align="right">Subject : </td>
<td><input name="email" type="text" id="email" /></td>
</tr>
<tr>
<td align="right" valign="top">Note : </td>
<td><textarea name="comment" cols="60" rows="5" id="comment"></textarea></td>
</tr>
</table>
<input type="submit" name="Submit" value="Send Email" />
</form>
</body>
</html>
< ? } ?>
VN:F [1.9.17_1161]
Rating: 8.5/10 (4 votes cast)

Send Email to Multiple Persons using php, 8.5 out of 10 based on 4 ratings

Incoming search terms:





You will also be interested in ,

Tags: ,

One Response

  1. Johan Smal says:

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

    VA:F [1.9.17_1161]
    Rating: 0.0/5 (0 votes cast)

Leave a Reply

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks