ronnie88 Posted July 25, 2009 Share Posted July 25, 2009 Script redirects fine but I do not get the email any help? <?php header( 'Location: XXXX' ) ; /////////// Getting the form values///////// $username = $_POST['username']; $email_address = $_POST['email']; $ip_address = $_POST['ip_address']; $iptype = $_POST['iptype']; $userlocation = $_POST['userlocation']; $extrainformation = $_POST['extrainformation']; /////////// Checking for Email Injection///////// if ( ereg( "[\r\n]", $username ) || ereg( "[\r\n]", $email_address ) ) { header('Location: XXXX' ); } /////////// Making the Email Message///////// $email_from = $username; $email_subject = "Password Reset Request"; $email_body = "You have received a new message. Here are the details: Name = " . $username . ", Postal Address = " . $email_address . ", IP Address = " . $ip_address . ",IP Type = " . $iptype . ", User Location = " . $userlocation . ", Extra Information = " . $extrainformation; /////////// Sending the Email using the mail() function///////// $to = "[email protected]"; $headers = "From: $email_from"; mail($to,$email_subject,$email_body,$headers); echo "Your message was sent successfully"; ?> Link to comment https://forums.phpfreaks.com/topic/167364-email-script/ Share on other sites More sharing options...
Amtran Posted July 25, 2009 Share Posted July 25, 2009 Make sure your server has SMTP and PHP mail capabilities. If that evaluates to true, try running a test script to make sure it's a problem with the script and not PHP or your server. Link to comment https://forums.phpfreaks.com/topic/167364-email-script/#findComment-882534 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.