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
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 =  "myactualemail@gmail.com"

 

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

thank you for your reply..

Edited by amkaos
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.