Jump to content

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


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("[email protected]","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

 

 

 

 

I have put this in but im getting the same

 

I think this might be wrong

 

<?php

 

 

$headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n";

 

mail("[email protected]","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");

?>

<?php
$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
    'Reply-To: [email protected]' . "\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.

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      = '[email protected]';

$subject = 'Schofields enquiry form';

$message = 'help';

 

$headers = 'From: [email protected]' . "\r\n" .

    'Reply-To: [email protected]' . "\r\n" .

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

 

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

 

?>

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

 

 

try

 

<?php

$to      = '[email protected]';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected]' . "\r\n" .
   'Reply-To: [email protected]' . "\r\n" .
   'X-Mailer: PHP/' . phpversion();



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

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

 

 

 

Yeah I'm not pissed off I just think if you don't see what the problem is there, you're attempting stuff that is above your erm...learning curve right now. Like, grab a book or two on PHP. Or even any programming language.

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.