Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 07-11-2006, 07:09 AM   PM User | #1
elvislivz2
New to the CF scene

 
Join Date: Jul 2006
Location: Vancouver, Miami
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
elvislivz2 is an unknown quantity at this point
Unhappy email formating problems caused when adding Input Type

I am not too good a php - even though my site is all php - need to find some reliable. Here's my problem:

I tried adding email response forms and they are giving me wierd responses:

This is blowing up in ways that I can't describe:

<?
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$message = $_REQUEST['message'] ;

mail( "myemail@mydomain.com", "eDateTravel.com Link request form",

$message, $name, "From: $email" );
header( "Location: http://www.edatetravel.com/refer/thankyou.html" );
?>

When getting info from a html file containing this:

<?
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$message = $_REQUEST['message'] ;

mail( "myemail@mydomain.com", "eDateTravel.com Link request form",

$message, $name, "From: $email" );
header( "Location: http://www.edatetravel.com/refer/thankyou.html" );
?>


The app totally blows up giving me the site administrator's email address.

Can anyone help I've spent hours of trial and error.

Last edited by elvislivz2; 07-11-2006 at 05:31 PM..
elvislivz2 is offline   Reply With Quote
Old 07-11-2006, 07:14 AM   PM User | #2
Fumigator
Master Coder

 
Fumigator's Avatar
 
Join Date: Dec 2005
Location: Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
Posts: 6,378
Thanks: 40
Thanked 479 Times in 468 Posts
Fumigator is just really niceFumigator is just really niceFumigator is just really niceFumigator is just really niceFumigator is just really nice
Any error message?

Quote:
This is blowing up in ways that I can't describe:
Give it a try.
Fumigator is online now   Reply With Quote
Old 07-11-2006, 03:34 PM   PM User | #3
Spookster
The Infractionator-inator


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 5,603
Thanks: 3
Thanked 21 Times in 21 Posts
Spookster is on a distinguished road
More descriptive subject

In the future, please use a more descriptive subject when posting a question. See posting guidelines.
__________________
Spookster
CodingForums Tyrant
All Hail Spookster
Where do you want to go today? Microso... errr Wrong!!! Make the switch Ubuntu Linux
Spookster is offline   Reply With Quote
Old 07-11-2006, 04:23 PM   PM User | #4
arnyinc
Regular Coder

 
Join Date: Jan 2003
Posts: 865
Thanks: 4
Thanked 8 Times in 8 Posts
arnyinc is an unknown quantity at this point
Are you on Windows or Linux?

Do you have a mail server running?
arnyinc is offline   Reply With Quote
Old 07-11-2006, 04:34 PM   PM User | #5
TheShaner
Senior Coder

 
TheShaner's Avatar
 
Join Date: Sep 2005
Location: Orlando, FL
Posts: 1,118
Thanks: 2
Thanked 37 Times in 37 Posts
TheShaner will become famous soon enoughTheShaner will become famous soon enough
Quote:
Originally Posted by elvislivz2
I am not too good a php - even though my site is all php - need to find some reliable. Here's my problem:

I tried adding email response forms and they are giving me wierd responses:

This is blowing up in ways that I can't describe:

<?
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$message = $_REQUEST['message'] ;

mail( "myemail@mydomain.com", "eDateTravel.com Link request form",

$message, $name, "From: $email" );
header( "Location: http://www.edatetravel.com/refer/thankyou.html" );
?>

When getting info from a html file containing this:

<?
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$message = $_REQUEST['message'] ;

mail( "mail@mail.com", "eDateTravel.com Link request form",

$message, $name, "From: $email" );
header( "Location: http://www.edatetravel.com/refer/thankyou.html" );
?>


The app totally blows up giving me the site administrator's email address.

Can anyone help I've spent hours of trial and error.
Ok, first, if the form is being posted, use $_POST instead of $_REQUEST.

Second, your parameters are a little messed up and third, your From header doesn't have a \n at the end. The mail() function typically works like so:
Code:
mail($to, $subject, $message, $headers);
So, yours should look like:
Code:
mail("mail@mail.com", "eDateTravel.com Link request form", $message, "From: $email\n");
If you're looking on putting their name in the body of the message, do something like:
Code:
mail("mail@mail.com", "eDateTravel.com Link request form", $name.",\n\n".$message, "From: $email\n");
-Shane

Last edited by TheShaner; 07-11-2006 at 05:45 PM..
TheShaner is offline   Reply With Quote
Old 07-11-2006, 04:51 PM   PM User | #6
elvislivz2
New to the CF scene

 
Join Date: Jul 2006
Location: Vancouver, Miami
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
elvislivz2 is an unknown quantity at this point
Smile

Quote:
Originally Posted by Fumigator
Any error message?



Give it a try.
Thanks for your response - I aam running windows mail server and I get the following error code before receiving the email:

I know this is probabily a simple problem. I don;t know much about coding except trial and error.

I own this site - it's about 700+ inc files that I've had build - but get too frustarted by all the ripoffs by tech people - so I am trying to learn some of the basics - yikes!!! I could tell you stories about India programing 'teams' that would simply curl you hair!

This email response from was working fine before I tried to modify it.

I wanted to get more detail from my users - so in the html i added this line:

Provide Exact URL Location of our Link. <br />
<INPUT TYPE="text" NAME="name" SIZE="50">


In the php file you can see where I added the $name field

<?
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$message = $_REQUEST['message'] ;

mail( "myemail@mydomain.com", "eDateTravel.com Link request form",

$message, $name, "From: $email" );
header( "Location: http://www.edatetravel.com/refer/thankyou.html" );
?>

Here is the error I am getting:

Task 'mail.ujammin.com - Receiving' reported error (0x800CCC90) : 'Your incoming (POP3) e-mail server has reported an internal error. If you continue to receive this message, contact your server administrator or Internet service provider (ISP). The server responded: -ERR Message unavailable'
. The problem I am having is the format and what i receive in the email.

Finially I get the email - but here are the problems:

1. The $email does not have the email address I entered - it's the admin address of the guy that rund the server ( I am on his webserver) but it is located in the email field,

2. The $name data is nowhere to be found

3. The $message data is OK - located in the body of the email

I know adding the $name lines messed this up since I have simple response forms working fine.

Last edited by elvislivz2; 07-11-2006 at 05:32 PM..
elvislivz2 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:05 PM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.