close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Adding Form Variables Causes Email to Fail

Thread began 3/05/2013 4:49 am by jennifersaas446228 | Last modified 3/05/2013 6:59 am by jennifersaas446228 | 698 views | 2 replies

jennifersaas446228

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;
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...