Jump to content

PHP email function problem


foolygoofy

Recommended Posts

I have this form on my site that it was working until recently and that I have use for years.  All of a sudden it stops working on all my sites.  It works by the user arriving at the page “contact.php” where the user fills up the form and press send.  Here is the code for that page in a simple form.

 

<html>

<head>

<title>SITE TITLE</title>

</head>

<body>

<form action="ContactSent.php" method="post">

Enter Name: <input name="name" type="text" id="name">

<input type="submit" name="Submit" value="Send">

</form>

</body>

</html>

 

Once the user presses send, it is taken to another page.  This new pages is  “contactSent.php” where the user is told that his info was sent and then using php functions an email is generated and sent to the email that you set up in the php code.  Here is the code for this page

 

<html>

<head>

<title>SITE TITLE</title>

</head>

<body>

 

<?php

$ipi = getenv("REMOTE_ADDR");

$httprefi = getenv ("HTTP_REFERER");

$httpagenti = getenv ("HTTP_USER_AGENT");

?>

  <input type=hidden name="ip" value="<?php echo $ipi ?>">

  <input type=hidden name="httpref" value="<?php echo $httprefi ?>">

  <input type=hidden name="httpagent" value="<?php echo $httpagenti ?>">

 

<?php

$myemail = "USER@DESTINATIONYOUCHOOSE.COM";

 

if (!isset($email))

echo "$ip" ;

 

$todayis = date("l, F j, Y, g:i a") ;

 

$subject = "EMAIL SUBJECT";

 

$message = "

Name: $name \n

$ipi \n

$todayis [EST]

";

 

$from = "From: $myemail\r\n";

 

if ($myemail != "")

mail($myemail, $subject, $message, $from);

 

?>

 

message sent

</body>

</html>

 

And so it stopped working partially.  I get the email in the inbox, I see that variables values of the date, ip, etc.  The only things I don’t see are the values inside of $message.  I get would get any text typed inside the function, but not the value of the variables.  I’m suppose to get something like this:

 

Name: WHATEVER NAME IT WAS ENTERED

 

Instead I just get

 

Name:

 

Going deeper in details, all the sites are hosted at different host companies.

 

Thanks

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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