Hi:
i search as to why my database wont send out emails and find this forum.
i find the exact code im using in this forum.. it originally is for xaamp.
i need to have it work from my server:

http://www.daniweb.com/web-development/php/threads/412468/how-to-send-mail-to-email-address-on-mysql-database.

i posted on https://gist.github.com/amkaos/5608094
but i can post code here if need be..

this is what is going on:
i have domain and web host.

i type in address to pull up a form that pulls all names and emails
from mysql database. at top of page "connected successfully"

there is message box for me to type text.
when i hit submit, i get all "connected successfully , emails processed"..
But no emails are sent ..
there are no errors..

my web host looked over my code and thinks it should be fine..
they are not restricting any outgoing emails..
they said i do not have to configure anything different.

i have a "Contact Form" on my domain and users fill out and submit to my email just fine.. i get the info sent to my gmail and it is added to Database..

i am desperate to fix this ..
any help is greatly appreciated

thanks

Recommended Answers

All 6 Replies

Where is the code for send.php or is that what gistfile1.txt is?

This part:

// 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 );
}
}

You seem to be using multiple $_GET, but you have one that has an additional space:

Line 16 from Index.php:

 echo "<input type = 'checkbox' name = 'mail_ ".$mailcount++." ' value 

This should be:

 echo "<input type = 'checkbox' name = 'mail_".$mailcount++." ' value 

Note the removal of the additional spacing between mail_ " as this will bugger your $_GET from your if ($_GET["mail_$x"]).

Also the same for this line in Index.php:

<input type = 'hidden' name='name_ ".$namecount++."' value = 

Additional spacing -> beware of those

@squidge..you are correct..im sorry,
i mislabled it
thanx

Member Avatar for diafol

BTW: please don't use bbcode tags - we don't use them anymore. Use the markdown syntax afforded by the toolbar in the editor. Thanks.

@Squidge. i made changes, but it didnt make any difference..i will be careful . thanx, any other thoughts?

Have you tried sending a single email? where $to is a set email address (your own for example).

Have you dumpped your $_GET variable to make sure it is being populated?

i did those things but .. i just now fixed this prob:: i made php.ini and send.ini.. uploaded to server. works fine except i get a Undefined index: error .. i will post new.. thanx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.