jigsawsoul Posted August 9, 2009 Share Posted August 9, 2009 i used this same code before and it seemed to work just fine, but now i don't seem to get sent any email's although it echo's confirmation email sent. any ideas why this happening ? $result = "SELECT * FROM events e LEFT JOIN artists ON e.artist_id=artists.artist_id LEFT JOIN venues ON e.venue_id=venues.venue_id LEFT JOIN sales ON e.event_id=sales.event_id LEFT JOIN gb_login ON sales.login_id=gb_login.login_id LEFT JOIN gb_customers ON gb_login.customer_id=gb_customers.customer_id WHERE e.event_id = {$_GET['id']}"; $result = mysql_query( $result ) or die ( mysql_error() ); $row = mysql_fetch_assoc ( $result ); $current_venue = $row['venue']; $current_artist = $row['artist']; $current_date = $row['date']; $current_price = $row['price']; $user_email = $row['email']; $user_firstname = $row['firstname']; $user_surname = $row['surname']; $subject = "Event Confirmation"; $web = "Gig Bookers"; $msg = "Gig Bookers - This is a confirmation email to say you have purchased $reqtickets Ticket(s) at price $current_price per ticket for $current_artist playing at $current_venue on $current_date. Thank You"; $body = "Sender: " . $user_firstname . " " . $user_surname . "\n\nEmail: " . $email . "\n\nWebsite: " . $web . "\n\nMessage:\n\n" . $msg; if (mail($email, $subject, $body)) { echo("confirmation email sent"); } else { echo("confirmation email couldn't send"); } Link to comment https://forums.phpfreaks.com/topic/169466-solved-sending-a-email-using-php-help/ Share on other sites More sharing options...
KPH71 Posted August 9, 2009 Share Posted August 9, 2009 Looking at the code - I can't see where $email is defined. You've defined $user_email = $row['email']; from the database - I assume that this is the variable that you want. Link to comment https://forums.phpfreaks.com/topic/169466-solved-sending-a-email-using-php-help/#findComment-894130 Share on other sites More sharing options...
jigsawsoul Posted August 9, 2009 Author Share Posted August 9, 2009 i have checked all the $rows by echoing them all out and they are all showing the right data too. and email address Link to comment https://forums.phpfreaks.com/topic/169466-solved-sending-a-email-using-php-help/#findComment-894131 Share on other sites More sharing options...
KPH71 Posted August 9, 2009 Share Posted August 9, 2009 I modified my previous message - you have defined $user_email from the database and then used $email in the message and the email. Link to comment https://forums.phpfreaks.com/topic/169466-solved-sending-a-email-using-php-help/#findComment-894133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.