trying to make a code that will send a confirmation email to my members, when they join up it will send it directly to there emails, only to new members, i have tried couple different factors but it wont send out anything. any suggestions?
$EMAIL=mysql_result($resultt,$it,"EMAIL");
$to = $EMAIL;
$subject = "Florida Fields To Forks - Order Confirmation";
$message = "Thank for your order! You can check your order here: http://www.floridafieldstoforks.com/order.php?orderid=$orderid";
$from = "floridafieldstoforks@gmail.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
check the value of the var $to because the send can be fail if you don't have the correct format of the email address, if the addresses are more than one check that they be separated by comma.
I tested you code and it worked perfect in my server.
An other posibility is that you are sending the email from gmail.com domain. Gmail can block yor ip because your ip is not authorized to send mails of that domain.
test your code changing the domain of the from address
If the order id is "1001". Save the order id in DB with current User id (User id of current placed order ) .
In mail send Order id http://www.floridafieldstoforks.com/order.php?orderid=1001
In order.php file write the query as.
$query= "Select user_id from TABLE where order_id='1001'";
mysql_query($query);
And set the session user_id from the query result.