I'm having the same problem. I get the error:
Warning: mail(): SMTP server response: 550 Requested action not taken: mailbox unavailable or not local
Now, the client has their own internal mail server, but using outside hosting. I just can't figure this out.. but I have a theory.
I can use the following script below and it works fine if I put my own email or other emails that doesn't have cadresys.com at the end of it. I'm thinking it's some issue with SMTP authentication and I have no idea how to set that up in the form. You can look at my code and tell me what I'm doing wrong. I'm no expert with this stuff, but I can use it enough to get by.
code:
<?php
error_reporting(E_ALL ^ E_NOTICE);
if(!$_POST['erf_Name']) {
$errMessage = "Name required!<BR> ";
}
if(!$_POST['erf_Phone']) {
$errMessage .= "Phone number required!<BR> ";
}
if(!$_POST['erf_Event']=="Select desired event") {
$errMessage .= "Please select desired event.<BR> ";
}
if(!$_POST['erf_NumberofAttendees']) {
$errMessage .= "Please tell us how many will attend.<BR> ";
}
if(!$_POST['erf_HearAbout']=="Select...") {
$errMessage .= "Please answer how you heard about us.<BR> ";
}
if(!strrchr($_POST['erf_Email'],"@") || !strrchr($_POST['erf_Email'],".")){
$errMessage .="Invalid email!<BR>";
}
$xHeaders = $_POST['$erf_Email'];
if($_POST['erf_Event']=="Augi Cad Camp in Charlotte May 3rd") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="Carolinas Expo Feb 15th") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="NC Revit User Group- May 10th") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="NC Revit User Group- April 12th") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="NC Revit User Group- March 8th") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="NC Revit User Group- Febuary 8th") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="SouthEast Design March 7th") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="North Carolina Society Feb 1st") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
if($_POST['erf_Event']=="South-Tec Advanced October 10th") {
$to = "somebody1@cadresys.com, somebody2@cadresys.com";
}
$name = $_POST['erf_Name'];
$event = "Event Confirmation " . $_POST['erf_Event'];
$bodyNote .= "<--- Note: Please send a confirmation email to the persons email below. --->" . "\n" . "--- Copy this text and paste in email ---" . "\n" . "This is a confirmation email from Cadre Systems that we recieved " . $_POST['erf_Name'] . " request for " . $_POST['erf_Event'] . " event" . "\n" . "\n";
$bodyName .= "Name: " . $_POST['erf_Name'] . "\n" . "\n";
$bodyCompany .= "Company: " . $_POST['erf_Company'] . "\n" . "\n";
$bodyAddress .= "Address: " . "\n" . $_POST['erf_Address1'] . "\n" . $_POST['erf_Address2'] . "\n" . $_POST['erf_City'] . " " . $_POST['erf_State'] . " " . $_POST['erf_ZipCode'] . "\n" . "\n";
$bodyPhone .= "Phone: " . $_POST['erf_Phone'] . $_POST['erf_Ext'] ."\n" . "\n";
$bodyEmail .= "Email Address: " . $_POST['erf_Email'] . "\n" . "\n";
$bodyEvent .= "Event: " . $_POST['erf_Event'] . "\n" . "\n";
$bodyAttendees .= "Number of Attendees: " . $_POST['erf_NumberofAttendees'] . "\n" . "\n";
$bodyHear .= "How did you hear about us: " . $_POST['erf_HearAbout'] . "\n" . "\n";
$bodyComments .= "Comments: ". "\n" . $_POST['erf_Comments'] ;
$message = "$bodyNote" . "$bodyName" . "$bodyCompany" . "$bodyAddress" . "$bodyPhone" . "$bodyEmail" . "$bodyEvent" . "$bodyAttendees" . "$bodyHear" . "$bodyComments";
$sent = "Thank you for your email " . $name . " Your request for the " . $_POST['erf_Event'] . " event has been sent to Cadre Systems." . " An email confirmation will be sent to you shortly.";
if(!isset($errMessage)) {
mail($to, $event, $message, $xHeaders);
echo "$sent";
}
Of course, this script works with my own email or other yahoo.. ect accounts. Also, I know others may have a better technique that what I have and if so.. please share. I probably should be using an array for the if statements, but right now I'm just making something work.
Other strange things to maybe help solve this problem, is I have trouble sending these people an email from my main email address thru my webmail and my local email application. Even happens with my secondary email address. I don't have this problem with anyone else.. just these people at Cadresys.com. So, I'm wondering if it's a firewall thing or what?
I appreciate all the help I can get on this. And one last thing I was trying to do was cc the person who sent the form. Instead, I'm going to have to have the company send an email to them once they recieve this email.. but unfortunately, I can't even get that to happen.