Solved

PHP to send email listing from field in email

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
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 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 …

706 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

20 Experts available now in Live!

Get 1:1 Help Now