close ad
Databridge V2 with MySQLi support IS Now Available!
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 Jason Byrnes | 645 views | 2 replies |


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:*****

//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:*****

$MailAttachments = "";
$MailBCC = "";
$MailCC = "";
$MailTo = "";
$MailBodyFormat = "";
$MailBody = "";
$MailImportance = "";
$MailFrom = "";
$MailSubject = "You Are Now Registered for Carolina Trash Cheap Mexican Campout 2013";

//Global Variables

$WA_MailObject = WAUE_Definition("","25","","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,"");
$WA_MailObject = WAUE_AddBCC($WA_MailObject,"");
$WA_MailObject = WAUE_AddBCC($WA_MailObject,"");

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

Sign in to reply to this post


Not sure what I did...

But it's working now lol. Been trying such small changes, was doing them in batches and not sure which of them fixed things but it's now working.

Sign in to reply to this post

Jason ByrnesWebAssist

Glad to hear you have it working.

The code you include in your message is incomplete, so it's pretty close to impossible to tell what the problem may have been, in the future, please compress the PHP page to a zip file to include the complete code.

one thing i see in your message, is that the to address is using a form element named "EmailAddy"

$RecipientEmail = "".$_POST["EmailAddy"] ."";include("WA_Universal_Email/WAUE_event_rego_1.php");

the you post the form field your testing with which does not have the same name, it is named "HName"

<input type="text" name="HName" value="" size="32" tabindex="4">

so perhaps the fix that worked was that you renamed that field or added another field named "EmailAddy"

Sign in to reply to this post

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





Ease of use


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...