Hey all. The company I work for recently asked me to redo their site. Unfortunately I'm having to code on an existing hosting setup running on a Windows Server. Luckily the site has PHP enabled even though the plan is geared at ASP. Thank God because ASP is pathetic. Anyway, while echoing the phpinfo() I noticed that sendmail is not configured... and why should it be? Technically it's a UNIX module so I didn't expect it to be. Here's my problem. The hosting company refuses to enable it for me even though they said our hosting platform does support it. Instead they want me to use PHP Formmail. Not going to happen. That script, while I'm sure it's good, is EXTREME overkill. All I really need is a simple mail() call to submit some form data. Here's my script. if anyone has any easy ways of getting the mail out in the absence of sendmail I'd really appreciate.
Please help and do not recommend taking pre-made scripts unless they are as simple as what I'm trying to do in my script. I don't have the time to go through and do a hack job on the code. I don't need all the regular expressions or validity checking. No fancy stuff, just send the mail.
<?
//Get the information to be emailed
$name = $_POST['name'];
$company = $_POST['company'];
$submitted = $_POST['date'];
$phone = $_POST['phone'];
$fax = $_POST['fax'];
$email = $_POST['email'];
$summary = $_POST['summary'];
$problem = $_POST['problem'];
$priority = $_POST['priority'];
//Check to ensure an e-mail address was provided
if(isset($email)){
if($email == ""){
echo "You did not enter a valid e-mail address. Please click <a href=javascript:history.go(-1);>here</a> and provide an address!";
die();
}
}
//Construct the message body
$message = "Name: ".$name."\nCompany: ".$company."\nSubmitted On: ".$submitted."\nPhone: ".$phone. "\nFax: ".$fax."\nE-mail: ".$email. "\nSummary: ".$summary."\n\nProblem(s): ".$problem.".";
//Construct the subject and recipient
$from = "From: $email\r\n";
$subject = $summary;
$recipient = "support@integratedaxis.com";
//Set some ini variables for sending e-mail
ini_set("SMTP","mail.integratedaxis.com");
ini_set("smtp_port","8889");
ini_set("sendmail_from",$recipient);
//Send the message
mail($recipient, $subject, $message, $from);
?>
<html>
<head>
<title>Thank You!</title>
<script language="JavaScript" type="text/javascript">
<!--
var sec = 0;
function closewindow() {
sec++;
if (sec == 10) {
window.parent.close();
}
window.setTimeout("closewindow();", 500);
}
//-->
</script>
</head>
<body bgcolor="#ffffff" onload="closewindow();">
<center>Thank you! Your message has been sent! We will be in touch with you shortly!</center>
</body>
</html>