Jump to content

[Q]create mailing list from sql database


amkaos

Recommended Posts

hi:
i have this form.php..
type address for form and it displays all names and email
address from sql database.

i type in message into box and send to all recipients listed on form.
the connection is successful ..
the mail gets processed but no emails are sent.

i use this on a real web host.. not xammp etc.

i think the problem may be in this line but every change i tried
doesnt work.. ::

ini_set("SMTP", "mail.tap~~.com");  

 

full code here:

 require('connect.php'); 

// change php.ini smtp line
 ini_set("SMTP", "mail.tap~~.com"); 

// standard mail header 
$headers = "From: Tap~~"; 

// get meessage to send 
$message = $_GET['message']; 

// loop through names / emails on index form 
for ($x=0; $x<count($_GET); $x++)
{
    if ($_GET["mail_$x"])     
    {
         // mail setup
         $to =  $_GET["mail_$x"];
         $subject = "News From Tap~~";
         $body =  "Dear " . $_GET["name_$x"] . "
         \n\n $message \n\n Josh \n\n Tap~~ ";
         
         mail($to, $subject, $body, $headers );
    }
}
echo "All Mail Has Been Processed";

i have searched about this for hours..

i really appreciate the looksy
thanx

 

Link to comment
https://forums.phpfreaks.com/topic/278108-qcreate-mailing-list-from-sql-database/
Share on other sites

what have you done to find the problem....

 

  1. have you tested/verified the values of your variables?

 

  2. have you tried sending just 1 email to yourself using set values for the appropriate variables?

could you be a little bit more specific.. an example?

i did change this:

   $to =  $_GET["mail_$x"];

to this

   $to =  "[email protected]"

 

i have been sending to myself..w/o any love

thank you for your reply..

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.