PHP to send email listing from field in email

Posted on 2002-03-23
Last Modified: 2008-07-03
Hello -

I have a small php file that will send email from Flash. I can get the name, address, city, etc to work but it fails to show in the 'from' feild of the email client when email arrives (in fact the email show 'nobody' in the from field).

Here is a copy:

<TITLE>Welcome to to my site</TITLE>

$TextVariable = '&results=';
$response = 'Data Sent. Thank You...';

echo $TextVariable;
echo $response;
$return = "From: $name\r\n Reply-To: $email\r\n";

mail ("", "On Line Service Form Response", "

Good day -

You have a new entry:

Name:          $name          E-mail:     $email

Home phone:      $home
Work phone:      $work
Cell:           $cell

Address1:      $address1
Address2:      $address2
City:           $city
Zip:           $zip



Sent From : $REMOTE_ADDR"




What's wrong?


Question by:JPersinger
  • 2
  • 2

Accepted Solution

andriv earned 50 total points
ID: 6891804
Try adding a comma before return. To add the From you need the argument for addition headers. Without the comma it's adding it to the message.

Sent From : $REMOTE_ADDR",$return);


Author Comment

ID: 6891819
That did it!



Expert Comment

ID: 6891833
No Problem. It the little things that kill us and the most fustrating. It's amazing how a little comma can effect a script.

Author Comment

ID: 6891859
Yep. Sent me running in all sorts of directions. :)

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
calculated column 12 74
Whether to use true/false, yes/no or 0/1 11 51
.htaccess 5 12
Checking CSRF token within a function 36 14
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now