Current location: Hot Scripts Forums » Programming Languages » PHP » [SOLVED] email code problem


[SOLVED] email code problem

Reply
  #1 (permalink)  
Old 06-30-08, 02:13 PM
sujata_ghosh sujata_ghosh is offline
Wannabe Coder
 
Join Date: May 2006
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] email code problem

hi!

I have made this simple php text based sendemail code (its taking user info on a form and email it to the client) for my client:

it working fine on my end, but on client server, its sending blank email.

And look like the server support only php5 version,

PHP Code:

 <?php
 $Name 
$HTTP_POST_VARS["Name"];
 
$Email $HTTP_POST_VARS["Email"];
 
$Phone $HTTP_POST_VARS["Phone"];
 
$Comments $HTTP_POST_VARS["Comments"];
 
$mailto = [EMAIL="'anticlockonline@yahoo.com'"]'anticlockonline@yahoo.com'[/EMAIL];
$subject "User's Query";
$header "From: $Email\n";
$header $header."Return-Path: [EMAIL="anticlockonline@yahoo.com\n"]anticlockonline@yahoo.com\n[/EMAIL]";
$header $header."Reply-to: [EMAIL="anticlockonline@yahoo.com\n"]anticlockonline@yahoo.com\n[/EMAIL]";
$header $header."MIME-Version: 1.0\n";
$header $header."Content-Type: text/plain; charset=iso-8859-1\n";
$header $header."Content-Transfer-Encoding: 8bit\n";
$header $header."X-Priority: 1\n";
$header $header."X-MSMail-Priority: High\n";
$header $header."Importance: High\n";
$header $header."X-Mailer: PHP\n";
$header $header."X-MimeOLE: Produced By php\n";

$body =       "User's Information\n";
$body $body."-----------\n";
$body $body."Name                   : ".$Name."\n";
$body $body."Email                  : ".$Email."\n";
$body $body."Phone                  : ".$Phone."\n";
$body $body."Commnets            : ".$Comments."\n";

if(
mail($mailto,$subject,$body,$header)) 
{
 echo 
"Email Sent! Thank you. <br><a href=\"javascript:history.back()\";>Back</a>";
}
else 
{
  echo 
"Mail could not be sent!";
exit;
}
 
?>
so what do i need to do into this existing code so that it produce desired result?

Please help.

Thanks.

Last edited by Nico; 07-01-08 at 02:42 AM. Reason: Please use [php] wrappers when posting PHP code.
Reply With Quote
  #2 (permalink)  
Old 06-30-08, 02:20 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
$HTTP_POST_VARS were depreciated long ago (2002), are turned off by default in php5 (and probably the last versions of php4), and have been completely eliminated in upcoming php6.

Change all occurrences of $HTTP_POST_VARS to $_POST
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #3 (permalink)  
Old 07-01-08, 07:25 AM
sujata_ghosh sujata_ghosh is offline
Wannabe Coder
 
Join Date: May 2006
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
thanks mab for teaching me such important thing. it has worked.

i am very greateful you......... thanks a lot!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
comma separated email list problems.... Alith7 PHP 16 10-16-06 11:24 AM
problem sending html email + image dflip PHP 2 05-08-05 12:39 PM
Free Trial of Email Newsletter Campaign findyourhope General Advertisements 0 01-05-05 08:58 PM
need help to create a attachment on my email frankkk PHP 1 10-25-04 02:10 PM


All times are GMT -5. The time now is 07:48 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.