As I said, it was specific solution for a specific case.
If anybody wants to know how to use mass Email in php, this is the complete solution.
Mysql Table:
create table massemail(name varchar(60),email varchar(60));
<?php
//DB Class Begins
class DB {
function DB() {
$this->host = "your_host";
$this->db = "your_db";
$this->user = "your_username";
$this->pass = "youy_password";
$this->link = mysql_connect($this->host, $this->user, $this->pass);
mysql_select_db($this->db);
register_shutdown_function($this->close);
}
function query($query) {
$result = mysql_query($query, $this->link);
return $result;
}
function close() {
mysql_close($this->link);
}
}
//Class ends
//Custom mail function
function sendMail($mFrom,$mTo,$sujet,$body) {
$head = "From: ".$mFrom."\n";
$head .= "Reply-To: ".$mFrom."\n";
return mail($mTo,$sujet,$body,$head);
}
//Begining of everything
$DB= new DB();//New DB instance (object)
$result = $DB->query('select * from massemail') or die('the Query is failed: ' . mysql_error());
//Sending Emails...
$sender='you@yourdomain.com';
$title='Watch out! We could do Stuff in php';
$message='Do not tell people to do this or that, but give them a concrete solution, a solution that works, a real example..';
while ($row = mysql_fetch_object($result)){
sendMail($sender,$reciepient,$title,$message);
}
?>
That's it!