Adding Form Variables Causes Email to Fail
Hi there,
So after hours of trying to figure out what's happening here, I'm at a complete lost.
I have a registration form that is filled out, validated, then entered into a mySQL database using Dreamweaver's Insert Record. I have Universal Email set up to send out a confirmation thank you email to the email addy that was entered into the form. All good there.
The problem I'm running into is that if I try to put any post variables into the body of the email, the email fails and doesn't send. If I just use text only, it works. The confusing part is that the To email addy is a post variable and that works fine (though I know that value is kept in a different file).
Any help would be really, very appreciated!
*****Here's the code from the top of my form page:*****
<?php
if (($_SERVER["REQUEST_METHOD"] == "POST")) {
//WA Universal Email object="Mail"
//Send Loop Once Per Entry
$RecipientEmail = "".$_POST["EmailAddy"] ."";include("WA_Universal_Email/WAUE_event_rego_1.php");
//Send Mail All Entries
if ("event_rego2.php"!="") {
header("Location: event_rego2.php");
}
}
?>
*****Here's the form field I'm using to test with*****
<input type="text" name="HName" value="" size="32" tabindex="4">
*****Here's the WAUE_event_rego_1.php code that I have:*****
<?php
$MailAttachments = "";
$MailBCC = "";
$MailCC = "";
$MailTo = "";
$MailBodyFormat = "";
$MailBody = "";
$MailImportance = "";
$MailFrom = "hashcash@carolinatrash.com";
$MailSubject = "You Are Now Registered for Carolina Trash Cheap Mexican Campout 2013";
$_SERVER["QUERY_STRING"] = "";
//Global Variables
$WA_MailObject = WAUE_Definition("mail.jennifersaas.com","25","hashcash@carolinatrash.com","Carolina Trash Hash House Harriers","","");
if ($RecipientEmail) {
$WA_MailObject = WAUE_AddRecipient($WA_MailObject,$RecipientEmail);
}
else {
//To Entries
}
//Attachment Entries
//BCC Entries
$WA_MailObject = WAUE_AddBCC($WA_MailObject,"wolfie@carolinatrash.com");
$WA_MailObject = WAUE_AddBCC($WA_MailObject,"gm@carolinatrash.com");
$WA_MailObject = WAUE_AddBCC($WA_MailObject,"hashcash@carolinatrash.com");
//CC Entries
//Body Format
$WA_MailObject = WAUE_BodyFormat($WA_MailObject,0);
//Set Importance
$WA_MailObject = WAUE_SetImportance($WA_MailObject,"3");
//Start Mail Body
$MailBody = $MailBody . "<html><head></head><body>";
$MailBody = $MailBody . "<p>Thank you for registering!</p>\r\n";
$MailBody = $MailBody . "<p>";
$MailBody = $MailBody . ((isset($_POST["HName"]))?$_POST["HName"]:"");
$MailBody = $MailBody . "</p>\r\n";
$MailBody = $MailBody . "</body></html>";
//End Mail Body
$WA_MailObject = WAUE_SendMail($WA_MailObject,$MailAttachments,$MailBCC,$MailCC,$MailTo,$MailImportance,$MailFrom,$MailSubject,$MailBody);
$WA_MailObject = null;
?>