|
|
|
|
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
03-22-2006, 03:41 AM
|
#1
|
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
Posts: 1,194
|
Need Help
<?
$name = $_POST["nameInput"];
$subject = $_POST["subjectInput"];
$message = $_POST["messageInput"];
$forminfo =
"Name: $name\n
Subject: $subject\n
Message: $message";
$recipient = "info@michaelnovikov.com";
$subject = "You got a Query from www.MichaelNovikov.com";
$formsend = mail("$recipient", "$subject", "$forminfo");
?>
Basically this is an email form although when i recieve the email, everything is just fine except the sender in my window of Thunderbird is Nobody. The text information inside is all correct but the senders name is set to Nobody. Any ideas?
|
|
03-22-2006, 03:58 AM
|
#2
|
Status: Senior Member
Join date: Nov 2004
Location: Sweden
Expertise:
Software:
Posts: 857
|
$formsend = mail($recipient, $subject, $forminfo); ?
*edit- might be wrong havn't touched php in ages just what i could think of while browsing the mail function over @ php.net, tho it sends the emssage so i dont know
|
|
03-22-2006, 04:06 AM
|
#3
|
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
Posts: 1,194
|
The message does go through and i get all the following:
Name: test
Subject: test
Message: sdasdasdadas da sda dsa sda sdas dasd as das das das dasda sdas dasd asd as dasd
But the fact that if i look op where all my emails are listed, the Senders name there is viewed as Nobody
|
|
03-22-2006, 09:46 AM
|
#4
|
Status: Junior Member
Join date: Mar 2006
Location: England
Expertise:
Software:
Posts: 37
|
As I see it, there isn't actually a problem with your code. It gives you a blank "from" header, because you haven't actually set it. I've written my own version below, hope it works.
Code:
<?
$name = $_POST["nameInput"];
$email = $_POST["emailInput"];
$subject = $_POST["subjectInput"];
$message = $_POST["messageInput"];
$headers = 'From: '.$email. "\r\n"
$headers .= 'Reply-To: '.$email. "\r\n"
$headers .= 'X-Mailer: PHP/' . phpversion();
$forminfo =
"Name: $name\n
Email Address: $email\n
Subject: $subject\n
Message: $message";
$recipient = "info@michaelnovikov.com";
$subject = "You got a Query from www.MichaelNovikov.com";
$formsend = mail($recipient, $subject, $forminfo, $headers);
?>
As you might note, I've used an extra post variable- I took the senders email address. This looks neater in mail headers.
|
|
03-22-2006, 11:49 AM
|
#5
|
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
Posts: 1,194
|
|
|
03-22-2006, 02:30 PM
|
#6
|
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
Posts: 2,694
|
Just use my version michael.
|
|
03-22-2006, 02:52 PM
|
#7
|
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
Posts: 1,194
|
Originally Posted by Garrett
Just use my version michael.
|
Your version doesnt show the Senders name in my Thunderbird like i told you so i am looking forward for someone to fix it
|
|
03-22-2006, 03:58 PM
|
#8
|
Status: Member
Join date: Sep 2005
Location: United States
Expertise:
Software:
Posts: 286
|
Ok - Try this...
Code:
$formsend = mail($recipient, $subject, $forminfo, "FROM: From Whoever");
|
|
03-22-2006, 04:30 PM
|
#9
|
Status: Junior Member
Join date: Mar 2006
Location: England
Expertise:
Software:
Posts: 37
|
PHP Code:
<?
$name = $_POST["nameInput"];
$email = $_POST["emailInput"];
$subject = $_POST["subjectInput"];
$message = $_POST["messageInput"];
$forminfo =
"Name: $name\n
Email Address: $email\n
Subject: $subject\n
Message: $message";
$from = "From: $email \r\n";
$recipient = "info@michaelnovikov.com";
$subject = "You got a Query from www.MichaelNovikov.com";
$formsend = mail($recipient, $subject, $forminfo, $from);
?>
Simplified a tad, but it should be fine.
|
|
03-22-2006, 08:07 PM
|
#10
|
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
Posts: 1,194
|
Originally Posted by dangwood
PHP Code:
<?
$name = $_POST["nameInput"];
$email = $_POST["emailInput"];
$subject = $_POST["subjectInput"];
$message = $_POST["messageInput"];
$forminfo =
"Name: $name\n
Email Address: $email\n
Subject: $subject\n
Message: $message";
$from = "From: $email \r\n";
$recipient = "info@michaelnovikov.com";
$subject = "You got a Query from www.MichaelNovikov.com";
$formsend = mail($recipient, $subject, $forminfo, $from);
?>
Simplified a tad, but it should be fine.
|
Thanks a lot! Works fine now, i appreciate it
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|