Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2010, 03:16 PM
Registered User
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy PhP mail pretty please help

Well I hope it's okay if I ask a question about php on here, I'm not really sure, but this seemed like the place to go. So I've been having a ton of trouble with my script and I can't figure out why because I am not super familiar with php... but here's my story. I am supposed to build a website for the family business and they want it to have a mail.php in it. I said okie dokie and got to work. We use yahoo as our webhost, and their servers are running on php 4.1.3. I got a free template for the website off the internet, which came with a mail.php and edited to what I thought it was supposed to be, however, the mail isn't working. I'm not sure what version the script is written in, so it may be that the script and yahoo's servers are not compatible, or maybe I just did it all wrong, I'm not sure... but here's the script:
<?
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$message=$_POST['message'];

$ToEmail = "[email protected]";
$ToSubject = "Contact Form from The Website";

$EmailBody = "Name: $name\n
Email: $email\n
Phone: $phone\n
Message: $message\n";

$Message = $EmailBody;


$headers .= "Content-type: text; charset=iso-8859-1\r\n";
$headers .= "From:".$email."\r\n";

mail($ToEmail,$ToSubject,$Message, $headers);

?>

Can anyone tell me what I've done wrong or what version of php this is written in?

Thanks for your time regardless and I hope you have a good day!
 
Old July 12th, 2010, 03:26 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
seems your code perfect... try to check following issue one by one.
1. try to put <?php without <?
2. check your form post method, otherwise change $_POST to $_REQUEST
3. check php.ini weather mail servicer activated
__________________
surendran
(Anything is Possible)
http://www.suren.info
http://ssuren.spaces.msn.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
stable xslt code for pretty printing xml anboss XSLT 5 October 28th, 2009 07:51 AM
This is pretty odd... Lee Dumond BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 June 28th, 2009 10:11 AM
this is pretty much a database question scottlucas58 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 February 24th, 2009 02:23 PM
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
Pretty nested printing with XSLT atteeela XSLT 1 August 23rd, 2007 02:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.