Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1906 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Need Help

Thread title: Need Help
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
03-22-2006, 03:41 AM
#1
mn is offline mn
mn's Avatar
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
 
Posts: 1,194
iTrader: 3 / 100%
 

mn is on a distinguished road

Send a message via AIM to mn Send a message via MSN to mn

  Old  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
hjalmar is offline hjalmar
Status: Senior Member
Join date: Nov 2004
Location: Sweden
Expertise:
Software:
 
Posts: 857
iTrader: 11 / 100%
 

hjalmar is an unknown quantity at this point

  Old

$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
mn is offline mn
mn's Avatar
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
 
Posts: 1,194
iTrader: 3 / 100%
 

mn is on a distinguished road

Send a message via AIM to mn Send a message via MSN to mn

  Old

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
dangwood is offline dangwood
Status: Junior Member
Join date: Mar 2006
Location: England
Expertise:
Software:
 
Posts: 37
iTrader: 0 / 0%
 

dangwood is on a distinguished road

Send a message via MSN to dangwood

  Old

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
mn is offline mn
mn's Avatar
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
 
Posts: 1,194
iTrader: 3 / 100%
 

mn is on a distinguished road

Send a message via AIM to mn Send a message via MSN to mn

  Old

http://www.michaelnovikov.com/Portfolio/PortfolioTest/

Still doesnt seem to work, now it gives an error.

03-22-2006, 02:30 PM
#6
Garrett is offline Garrett
Status: Waving
Join date: Aug 2005
Location:
Expertise:
Software:
 
Posts: 2,694
iTrader: 11 / 100%
 

Garrett is on a distinguished road

Send a message via MSN to Garrett

  Old

Just use my version michael.

03-22-2006, 02:52 PM
#7
mn is offline mn
mn's Avatar
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
 
Posts: 1,194
iTrader: 3 / 100%
 

mn is on a distinguished road

Send a message via AIM to mn Send a message via MSN to mn

  Old

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
Nirvana- is offline Nirvana-
Status: Member
Join date: Sep 2005
Location: United States
Expertise:
Software:
 
Posts: 286
iTrader: 0 / 0%
 

Nirvana- is on a distinguished road

  Old

Ok - Try this...
Code:
$formsend = mail($recipient, $subject, $forminfo, "FROM: From Whoever");

03-22-2006, 04:30 PM
#9
dangwood is offline dangwood
Status: Junior Member
Join date: Mar 2006
Location: England
Expertise:
Software:
 
Posts: 37
iTrader: 0 / 0%
 

dangwood is on a distinguished road

Send a message via MSN to dangwood

  Old

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
mn is offline mn
mn's Avatar
Status: Living the dream
Join date: Nov 2005
Location: New York
Expertise:
Software:
 
Posts: 1,194
iTrader: 3 / 100%
 

mn is on a distinguished road

Send a message via AIM to mn Send a message via MSN to mn

  Old

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

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed