close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Sending Email on an Update Form Page

Thread began 1/12/2010 10:21 am by karen.marley367377 | Last modified 1/14/2010 2:53 pm by Jason Byrnes | 1478 views | 7 replies |

karen.marley367377

Sending Email on an Update Form Page

Hi
I have an update form. The page includes two email server behaviours. I have left the redirect after update blank and set the first email server behaviour to redirect after button is pressed. The form updates okay but the email is not sent.

I have an email server behaviour on one of the details pages so I know the settings are correct.

<?php require_once("WA_Universal_Email/mail_PHP.php"); ?>
<?php require_once("WA_Universal_Email/MailFormatting_PHP.php"); ?>
<?php
// WA Application Builder Update
if (isset($_POST["submit"])) // Trigger
{
$WA_connection = $DBNAME;
$WA_table = "properties";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "MainPropertiesID";
$WA_fieldNamesStr = "Status";
$WA_fieldValuesStr = "".((isset($_POST["status"]))?$_POST["status"]:"") ."";
$WA_columnTypesStr = "',none,''";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);

$WA_where_fieldValuesStr = "".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);

$WA_connectionDB = $database_DBNAME;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<?php
if ((isset($_POST["test_x"]))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "".$row_rsmembers['EmailAddress'] ."";include("WA_Universal_Email/WAUE_Admin_properties_Update_1.php");

//Send Mail All Entries
if ("properties_Results.php"!="") {
header("Location: properties_Results.php");
}
}
?>
<?php
if ((isset($_POST["reset"]))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "".$row_rsmembers['EmailAddress'] ."";include("WA_Universal_Email/WAUE_Admin_properties_Update_3.php");

//Send Mail All Entries
if (""!="") {
header("Location: ");
}
}
?>

Your help is appreciated

Sign in to reply to this post

Jason ByrnesWebAssist

Double check the triggers.

The update is set to trigger when the button Submit is pressed:

php:
// WA Application Builder Update

if (isset($_POST["submit"])) // Trigger
{




the first universal email behavior is set to trigger when the button test is pressed:

php:
<?php

if ((isset($_POST["test_x"]))) {
//WA Universal Email object="mail"




the second is set to trigger when the button reset is pressed:

php:
<?php

if ((isset($_POST["reset"]))) {
//WA Universal Email object="mail"




try setting the UE behaviors to use the same trigger as the update behavior, button submit pressed.

Sign in to reply to this post

karen.marley367377

double check the triggers - email from update form

Hi Jason, Have tried changing the trigger on the UE to be the same as the update form, but this still does not work (code below)
<?php
// WA Application Builder Update
if (isset($_POST["submit"])) // Trigger
{
$WA_connection = $DBNAME;
$WA_table = "properties";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "MainPropertiesID";
$WA_fieldNamesStr = "Status";
$WA_fieldValuesStr = "".((isset($_POST["status"]))?$_POST["status"]:"") ."";
$WA_columnTypesStr = "',none,''";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);

$WA_where_fieldValuesStr = "".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);

$WA_connectionDB = $database_DBNAME;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<?php
if ((isset($_POST["submit"]))) {
//WA Universal Email object="mail"
//Send Loop Once Per Entry
$RecipientEmail = "recipient@recipient.com";include("WA_Universal_Email/WAUE_Admin_properties_Update_1.php");

//Send Mail All Entries
if ("properties_Results.php"!="") {
header("Location: properties_Results.php");
}
}
?>

Originally Said By: Jason Byrnes
  Double check the triggers.

The update is set to trigger when the button Submit is pressed:
php:
// WA Application Builder Update

if (isset($_POST["submit"])) // Trigger
{



the first universal email behavior is set to trigger when the button test is pressed:
php:
<?php

if ((isset($_POST["test_x"]))) {
//WA Universal Email object="mail"



the second is set to trigger when the button reset is pressed:
php:
<?php

if ((isset($_POST["reset"]))) {
//WA Universal Email object="mail"



try setting the UE behaviors to use the same trigger as the update behavior, button submit pressed.  
Sign in to reply to this post

Jason ByrnesWebAssist

Does the update occur?

Does the page redirect to the properties_Results.php page?


It would help if you sent the entire page instead of pasting the code so I could see the entire code in context.



in the code you send, you have the to address as recipient@recipient.com
$RecipientEmail = "recipient@recipient.com";

Is this what is entered on the live page? this is not a valid email address.

Sign in to reply to this post

karen.marley367377

sending emails on an update form

Hi Jason,
I am reluctant to attach the page for security reasons. Are we still able to submit support tickets?

Sign in to reply to this post

Jason ByrnesWebAssist

The file is not 100% necessary, we can continue on in this forum, but you have not addressed the other questions I asked:

Does the update occur?

Does the page redirect to the properties_Results.php page?

Is recipient@recipient.com what is entered on the live page for the to address?

Sign in to reply to this post

karen.marley367377

email on update form

the form updates correctly.
The redirect on the email server beviour redirects correctly as set.

I changed the email address for security.

Sign in to reply to this post

Jason ByrnesWebAssist

If the redirect is being performed, it is trying to send the email, but the SMTP server is not relaying it for some reason. check with your host to see if they can look into the smtp server error logs to determine why the email is not being relayed by the smtp server.

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

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