Jump to content

Newsletter script,mail function not working


TheFreak

Recommended Posts

Hello guys,

 

I am making a newsletter script,here is my piece of code which sends the newsletter choosing the users from the 3 lists.

 

 

 $mails="SELECT * from list WHERE listid='$lists'";
       
      $mails2=mysql_query($mails) or die("Could not select mails");
      while($mails3=mysql_fetch_array($mails2))
      {
         $headers = "From: Kingdom World \r\n"; 
         $headers.= "Content-Type: text/html; charset=ISO-8859-1 "; 
         $headers .= "MIME-Version: 1.0 ";
         mail("$mails3[address]","$subject","$matter",$headers);
         
         
      }
      print "Newsletter Sent";
   }

 

 

I have two questions

 

1.Will this while loop select every email in the database which come under suppose list1 ?

2.When i tested it,i get this error and i didnt recieve my mails

 

PHP Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Documents and Settings\blah\My Documents\MyNewsletter\admin\sendletter.php on line 35 PHP Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Documents and Settings\blah\My Documents\MyNewsletter\admin\sendletter.php on line 35 PHP Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Documents and Settings\blah\My Documents\MyNewsletter\admin\sendletter.php on line 35 

 

Can someone please help me with it?

 

Thankyou

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.