mail() function won't work

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
jaimeschu
Forum Newbie
Posts: 2
Joined: Wed Apr 15, 2009 1:09 pm

mail() function won't work

Post by jaimeschu »

Thank you in advance,
I have searched a while on this, can't find a solution. All I need is for a form to be submitted to my email address. I have a windows server if that helps. Will somebody be able to tell me the error in this code?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Thank You</title>
</head>
<body>

<?php

$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$companyName = $_POST['company_name'];
$companyAddress1 = $_POST['company_address1'];
$companyAddress2 =$_POST['company_address2'];
$companyCity = $_POST['company_city'];
$companyState = $_POST['company_state'];
$companyZip = $_POST['company_zip'];
$companyCountry = $_POST['company_country'];
$companyPhone = $_POST['company_phone'];
$companyFax = $_POST['company_fax'];
$name = $_POST['name'];
$title = $_POST['title'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$supervisorName = $_POST['supervisor_name'];
$supervisorPhone = $_POST['supervisor_phone'];
$supervisorEmail = $_POST['supervisor_email'];
$profile = $_POST['profile'];


$to = "myemail";
$subject = "Portal Registration";
$message = "
From:$name ($email)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
Company Name: $companyName \n
Address 1: $companyAddress1 \n
Address 2: $companyAddress2 \n
City: IP = $companyCity \n
State: $companyState \n
Zip: $companyZip \n
Country: $companyCountry \n
Phone: $companyPhone \n
Fax: $companyFax \n
Name: $name \n
Title: $title \n
Phone: $phone \n
Fax: $fax \n
Email: $email \n
Supervisor Name: $supervisorName \n
Supervisor Phone: $supervisorPhone \n
Supervisor Email: $supervisorEmail \n
Profile Type: $profile \n
";

mail($to, $subject, $message);
echo "Thank you for your request. You will be contacted shortly."
?>

</body>
</html>

thanks, --j
socket1
Forum Commoner
Posts: 82
Joined: Mon Dec 08, 2008 7:40 pm
Location: Shokan, New York

Re: mail() function won't work

Post by socket1 »

I think you need to configure your windows server like this first ... http://digiex.net/guides-tutorials/544- ... r-ssl.html
jaimeschu
Forum Newbie
Posts: 2
Joined: Wed Apr 15, 2009 1:09 pm

Re: mail() function won't work

Post by jaimeschu »

thank you, ill give it a try
Post Reply