Jump to content

Email script


ronnie88

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.