close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Captcha Doesn’t Work After Migrating my Website

Thread began 1/01/2024 11:45 pm by salaroche | Last modified 2/08/2024 10:47 am by salaroche | 360 views | 46 replies

Mags

OK, so we know that your server is running PHP5.6 (delete that phpinfo file now, it's not a good idea to keep it on your server). If your previous host was also running PHP5.6 and emails were being sent OK but still aren't sending from your new host, it's because you need to add those extra parameters they asked you to. Have you also added the SPF record to your domain?

Another reason the email might not be sending is if you have it set to come FROM the user's email. As you're sending mail via the server, you must make sure the "From" field uses an email address with a domain that's actually hosted by the server, otherwise it will most likely be flagged as a spoofing email. This will be why they've asked you to add the SPF record too, but best to do both. Set the "From" field in the send email box to your salaroche.com or .net email address so that the email is sent FROM you TO you - you can still include the sender's actual email address within the text of the email.

I've just set up a sample email script very quickly using your settings. I've also attached just the required email files & folders from the latest version of Databridge - you should unzip these to your webassist/email folder and upload.

The new code would look like this:

<?php require_once("webassist/email/WA_Email.php"); ?>
<?php
if (isset($_POST["SimpleContact_submit"]) || isset($_POST["SimpleContact_submit_x"])) { //WA Universal Email
$Email = new WA_Email("salaroche");
$Email->Redirect = "ESuccess.php";
$Email->From = "info@salaroche.com";
$Email->Method = "smtp";
$Email->Host = "relay-hosting.secureserver.net1";
$Email->Port = "25";
$Email->addTo("salaroche@gmail.com");
$Email->BodyFile = "webassist/email/waue_Contact_2.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "Contact from website";
$Email->send($emailGroup);
}
$Email->close();
}
?>

You would then remove the old script and file includes:

<?php require_once("webassist/email/mail_php.php"); ?>
<?php require_once("webassist/email/mailformatting_php.php"); ?>
<?php
if (!isset($_SESSION))session_start();
if ((isset($_POST["SimpleContact_submit"]))) {
//WA Universal Email object="mail"
set_time_limit(0);
$EmailRef = "waue_Contact_2";
$BurstSize = 200;
$BurstTime = 1;
$WaitTime = 1;
$GoToPage = "ESuccess.php";
$RecipArray = array();
$StartBurst = time();
$LoopCount = 0;
$TotalEmails = 0;
$RecipIndex = 0;
// build up recipients array
$CurIndex = sizeof($RecipArray);
$RecipArray[$CurIndex] = array();
$RecipArray[$CurIndex ][] = "salaroche@gmail.com";
$TotalEmails += sizeof($RecipArray[$CurIndex]);
$RealWait = ($WaitTime<0.25)?0.25:($WaitTime+0.1);
$TimeTracker = Array();
$TotalBursts = floor($TotalEmails/$BurstSize);
$AfterBursts = $TotalEmails % $BurstSize;
$TimeRemaining = ($TotalBursts * $BurstTime) + ($AfterBursts*$RealWait);
if ($TimeRemaining < ($TotalEmails*$RealWait) ) {
$TimeRemaining = $TotalEmails*$RealWait;
}
$_SESSION[$EmailRef."_Total"] = $TotalEmails;
$_SESSION[$EmailRef."_Index"] = 0;
$_SESSION[$EmailRef."_Remaining"] = $TimeRemaining;
while ($RecipIndex < sizeof($RecipArray)) {
$EnteredValue = is_string($RecipArray[$RecipIndex][0]);
$CurIndex = 0;
while (($EnteredValue && $CurIndex < sizeof($RecipArray[$RecipIndex])) || (!$EnteredValue && $RecipArray[$RecipIndex][0])) {
$starttime = microtime_float();
if ($EnteredValue) {
$RecipientEmail = $RecipArray[$RecipIndex][$CurIndex];
} else {
$RecipientEmail = $RecipArray[$RecipIndex][0][$RecipArray[$RecipIndex][2]];
}
$EmailsRemaining = ($TotalEmails- $LoopCount);
$BurstsRemaining = ceil(($EmailsRemaining-$AfterBursts)/$BurstSize);
$IntoBurst = ($EmailsRemaining-$AfterBursts) % $BurstSize;
if ($AfterBursts<$EmailsRemaining) $IntoBurst = 0;
$TimeRemaining = ($BurstsRemaining * $BurstTime * 60) + ((($AfterBursts<$EmailsRemaining)?$AfterBursts:$EmailsRemaining)*$RealWait) - (($AfterBursts>$EmailsRemaining)?0:($IntoBurst*$RealWait));
if ($TimeRemaining < ($EmailsRemaining*$RealWait) ) {
$TimeRemaining = $EmailsRemaining*$RealWait;
}
$CurIndex ++;
$LoopCount ++;
session_commit();
session_start();
$_SESSION[$EmailRef."_Index"] = $LoopCount;
$_SESSION[$EmailRef."_Remaining"] = round($TimeRemaining);
session_commit();
wa_sleep($WaitTime);
include("webassist/email/waue_Contact_2.php");
$endtime = microtime_float();
$TimeTracker[] =$endtime - $starttime;
$RealWait = array_sum($TimeTracker)/sizeof($TimeTracker);
if ($LoopCount % $BurstSize == 0 && $CurIndex < sizeof($RecipArray[$RecipIndex])) {
$TimePassed = (time() - $StartBurst);
if ($TimePassed < ($BurstTime*60)) {
$WaitBurst = ($BurstTime*60) -$TimePassed;
wa_sleep($WaitBurst);
}
else {
$TimeRemaining = ($TotalEmails- $LoopCount)*$RealWait;
}
$StartBurst = time();
}
if (!$EnteredValue) {
$RecipArray[$RecipIndex][0] = mysql_fetch_assoc($RecipArray[$RecipIndex][1]);
}
}
$RecipIndex ++;
}
$_SESSION[$EmailRef."_Total"] = 0;
$_SESSION[$EmailRef."_Index"] = 0;
$_SESSION[$EmailRef."_Remaining"] = 0;
session_commit();
session_start();
if (function_exists("rel2abs")) $GoToPage = $GoToPage?rel2abs($GoToPage,dirname(__FILE__)):"";
if ($GoToPage!="") {
header("Location: ".$GoToPage);
}
}
?>

Your form validations should still work with no need to update. You also don't have to rebuild any HTML as that has no bearing on the PHP code.

If you do the above, you should then be able to see and open the Send Email server behavior in the panel.

Do you use any database connections and insert/update/delete server behaviors? If you don't then you don't need to worry about connection files or updating any other server behaviors. If it's just the email contact form that isn't working, then the above steps should work for you. Keep a copy of your old page and files before making any changes though, just in case you need to roll back.

Attached Files
email.zip

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