hello
I have been trying to send email to a group of users found in my database, but the problem is the email is being sent but not received. I have also tried sending only to one recipient, it does not work either. I have already hosted my site
here is my code:
1st page
and the log.php page:
is there something wrong in my codes??
plzzz help
I have been trying to send email to a group of users found in my database, but the problem is the email is being sent but not received. I have also tried sending only to one recipient, it does not work either. I have already hosted my site
here is my code:
1st page
Code:
<html> <head> <title>Mailing List</title> </head> <body> <form method="post" action="log5.php"> <table align="center" bgcolor="#D6DEE7" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center"> <b><h2>MAILING LIST ADMIN</h2></b> Send message to: <select name="receiver" size="1" style="background-color: #F7F7F7"> <option selected value="all">Reviewer</option> <option value="notall">Author</option> </select><br /> <br /> Title or Subject: <input name="subject" type=text maxlength=100 size=40> <br /> <br /> Message: <textarea wrap name="message" rows=10 cols=45></textarea> <br /><br /> <input type=submit name="submit" value="SUBMIT"> </td> </tr> </table> </form> </body> </html>
Code:
<?php
include("db_connect.php");
$tom = $_POST['receiver'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$country = $_POST['country'];
$headers = 'From: myemail@yahoo.com';
if ($tom == "all") {
$result = mysql_query("SELECT Reviewer_email FROM reviewer");
$count = 0;
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC))
{
$to = $row['Reviewer_email'];
mail($to, $subject, $message, $headers);
$count++;
}
echo "myResult=$count Emails Sent. Done.";
}
if ($tom == "notall") {
$result1 = mysql_query("SELECT Author_email FROM author");
$count1 = 0;
while ($row1 = mysql_fetch_array ($result1, MYSQL_ASSOC))
{
$to = $row1['Author_email'];
mail($to, $subject, $message, $headers);
$count1++;
}
echo "myResult1=$count1 Emails Sent. Done.";
}
?>
<html>
<head>
</head>
<body>
SUCCESS!
</body>
</html>
plzzz help
Comment