Jump to content

my php form sends a nobody in thr from/sender field of my email


mightymouse

Recommended Posts

Hi dont know that much about php.

 

I have a form in my html page which is sent to a php file this file send the information to my email but it doesnt put a name in the sender field

 

im shure its going to be easy for you guys.

 

this is the code I have...

 

 

<?php

mail("myemail@yahoo.com","Schofields enquiry from \n".$_REQUEST['yourname'],"\n\nTel:\n".$_REQUEST['yourtel']."\n\nThis is the sender\n".$_REQUEST['youremail']."\n\nIam interested in a \n".$_REQUEST['mortgage']);

header ("Location: http://www.mywebsite/Schofields_thankyou.htm");

?>

 

this is what it looks like when it arrives in the email

 

From    Subject           

 

Nobody zebra enquiry from  martin

 

 

 

 

Link to comment
Share on other sites

I have put this in but im getting the same

 

I think this might be wrong

 

<?php

 

 

$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";

 

mail("myemail@yahoo.com","Schofields enquiry from \n".$_REQUEST['yourname'],"\n\nTel:\n".$_REQUEST['yourtel']."\n\nThis is the sender\n".$_REQUEST['youremail']."\n\nIam interested in a \n".$_REQUEST['mortgage']);

header ("Location: http://www.mywebsite/Schofields Mortgages/Schofields_thankyou.htm");

?>

Link to comment
Share on other sites

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);
?>

 

Change the email address and message to what you want, but don't change the mail() line.

Link to comment
Share on other sites

Im lost I got the from field right but now im having trouble getting all the

information from the form to send and still cant direct the php yo my thank you page what am I doing wrong

 

<?php

 

$to      = 'myemail@yahoo.com';

$subject = 'Schofields enquiry form';

$message = 'help';

 

$headers = 'From: monkeysneagles@yahoo.com' . "\r\n" .

    'Reply-To: webmaster@example.com' . "\r\n" .

    'X-Mailer: PHP/' . phpversion();

 

mail($to, $subject, $message, $headers "Location: http://www.mywebsite/Schofields Mortgages/Schofields_thankyou.htm");

 

?>

Link to comment
Share on other sites

i dont think you "pissed" her off. i think just annoyed her atad.

 

 

try

 

<?php

$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
   'Reply-To: webmaster@example.com' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();



mail($to, $subject, $message, $headers);

header("Location:  http://www.mywebsite/Schofields_thankyou.htm");
?>

 

 

 

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.