Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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 = "ichangedthisaddress@duncanfarms.net";
$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!
Reply With Quote
  #2 (permalink)  
Old July 12th, 2010, 03:26 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 481
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.