?
Solved

PHP to send email listing from field in email

Posted on 2002-03-23
4
Medium Priority
?
171 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 200 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

These days socially coordinated efforts have turned into a critical requirement for enterprises.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…
Suggested Courses

765 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