email script help

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
User avatar
PlagueInfected
Forum Newbie
Posts: 9
Joined: Sat Nov 29, 2008 3:25 pm
Location: Fort Worth Texas USA
Contact:

email script help

Post by PlagueInfected »

for some reason this script here wont send me the mail, am i missing some piece of code

<?php

$name = $_POST['name'];
$email = $_POST['email'];
$information = $_POST['information'];


$message= "From $name using an email address of $email sent:
information: $information
";

$send=mail("email@domain.com","online inquiry",$message);

if($send){
echo ( "Thanks for making an inquiry, we'll get back to you soon!" );
}
else{
echo ( "There was an error in completing your request, please try again");
}

?>
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: email script help

Post by jaoudestudios »

Try something like this...
http://www.forum.jaoudestudios.com/view ... ?f=13&t=13

Also what server are you running?
silenceghost
Forum Newbie
Posts: 22
Joined: Sun Oct 19, 2008 3:25 am

Re: email script help

Post by silenceghost »

your code doesn't have header
$header="From: ".$from;
mail($to,$subject,$message,$header);
User avatar
PlagueInfected
Forum Newbie
Posts: 9
Joined: Sat Nov 29, 2008 3:25 pm
Location: Fort Worth Texas USA
Contact:

Re: email script help

Post by PlagueInfected »

jaoudestudios from your icon i'd rather not tell you lol

Windows IIS/6.0 running off of godaddy

ima try the latest post first and if it fails I'll try yours because I'd need to make my own form for it too lol
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: email script help

Post by jaoudestudios »

haha.... :D

The reason I asked was because a lot of developers use WAMP at home and try to send mail but windows does not come with a mailserver.

Keep us posted. You'll get there in the end :)
User avatar
PlagueInfected
Forum Newbie
Posts: 9
Joined: Sat Nov 29, 2008 3:25 pm
Location: Fort Worth Texas USA
Contact:

Re: email script help

Post by PlagueInfected »

so far the easier looking code didnt work, ima try your but idk what variables to call from on the form yet =/ ima still look at it and see how it works.

i cant make my own server yet so i do my hosting elsewhere lol
Post Reply