Newsletter and smtp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear friends,

While sending newsletter, using mailing list, php script is able to connect 
to database, retrieve emails, however is unable to send newsletter or email.
I am using localhost.

I have SMTP installed on local machine.
Any guidance

------------------------------------------------------------------------
Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to 
send mail from your AOL screen name. 
http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44
newsletter sent to: mamu@xxxxxxx

Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to 
send mail from your AOL screen name. 
http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44
newsletter sent to: ice101@xxxxxxx

Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to 
send mail from your AOL screen name. 
http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44
newsletter sent to: globe@xxxxxxx
----------------------------------------------------------------------
script to send mail
----------------------------------------------------
<?php
if ($_POST[op] != "send") {
   //haven't seen the form, so show it
   print "
   <HTML>
   <HEAD>
   <TITLE>Send a Newsletter</TITLE>
   </HEAD>
   <BODY>
   <h1>Send a Newsletter</h1>
   <form method=\"post\" action=\"$_SERVER[PHP_SELF]\">
   <P><strong>Subject:</strong><br>
   <input type=\"text\" name=\"subject\" size=30></p>
   <P><strong>Mail Body:</strong><br>
   <textarea name=\"message\" cols=50 rows=10 wrap=virtual></textarea>
   <input type=\"hidden\" name=\"op\" value=\"send\">
   <p><input type=\"submit\" name=\"submit\" value=\"Send It\"></p>
   </FORM>
   </BODY>
   </HTML>";

} else if ($_POST[op] == "send") {
    //want to send form, so check for required fields
    if (($_POST[subject] =="") || ($_POST[message] == "")) {
       header("Location: sendmymail.php");
       exit;
   }

   //connect to database
   $conn = mysql_connect("localhost", "", "") or die(mysql_error());
   mysql_select_db("b",$conn)  or die(mysql_error());

   //get emails from subscribers list
   $sql = "select email from subscribers1";
   $result = mysql_query($sql,$conn) or die(mysql_error());

   //create a From: mailheader
   $headers = "<globalvoice101@xxxxxxx>\n";

   //loop through results and send mail
   while ($row = mysql_fetch_array($result)) {
       set_time_limit(0);
       $email = $row['email'];
       mail("$email", stripslashes($_POST[subject]), 
stripslashes($_POST[message]), $headers);
       print "newsletter sent to: $email<br>";
   
   }
}
?>

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux