Solved

PHP to send email listing from field in email

Posted on 2002-03-23
4
164 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 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