Solved

PHP to send email listing from field in email

Posted on 2002-03-23
4
167 Views
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:

<HTML>
<HEAD>
<TITLE>Welcome to to my site</TITLE>
<BODY>
<?php

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

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


mail ("myemail@anywhre.com", "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

Comments:    

$comments

Sent From : $REMOTE_ADDR"

$return

);

?>

What's wrong?

Thanks

Jim
0
Comment
Question by:JPersinger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
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);




0
 

Author Comment

by:JPersinger
ID: 6891819
That did it!

Thanks

Jim
0
 
LVL 5

Expert Comment

by:andriv
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.
0
 

Author Comment

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

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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.

688 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