Hello I need some help on Php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bucketheadfan
Forum Newbie
Posts: 4
Joined: Fri Dec 24, 2010 1:44 pm

Hello I need some help on Php

Post by Bucketheadfan »

I am a rookie at php and all I need is to create a php page to send information in a form to my email account. This website is for a friend so I will be changing the email when I am done to her email. I have attached my php page that I have started and all i want to happen right now is to get a simple email to my account just to see when it works so if anyone could help me out It would be much appreciated.


<?php
$name=$_POST['name'];
$address=$_POST['address'];
$city=$_POST['city'];
&email=$_POST['email'];

$email_from='myemail@yahoo.com';
$email_subject="Foster Form Submission";
$email_body="hello";

$to="myemail@yahoo.com";
$headers = "From: $email_from /r/n";
$headers .="Reply-To: $email /r/n";

mail($to,$email_subject,$email_body,$headers);

?>
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Hello I need some help on Php

Post by Darhazer »

Code: Select all

$headers = "From: $email_from /r/n";
$headers .="Reply-To: $email /r/n";
have to be

Code: Select all

$headers = "From: $email_from \r\n";
$headers .="Reply-To: $email \r\n";
Your hosting should allow mail() or if you are running this on your computer, you need SMTP.
Post Reply