My same customer that was having slow down issues with Web5 is now seeing the following error:
“Error 2: Language string failed to load: connect_host”
He has the PHPMailer script (been in place for a couple of years" is all of a sudden failing on the new server.
Here is the code he has had in place for a while (minus private stuff)
[PHP]
<? // This is the email address showing who it came from // Simply store it in a variable $txtSender = "[email protected]"; // We are now going to create an instance of the PHPMailer class // which is similar to creating an instance of a form in Delphi SomeForm1 := tFormClass.Create() $mail = new PHPMailer(); $mail->IsSMTP(); // This tells us we are going to use SMTP for the mail type $mail->Host = "mail.hisdomain.com"; // Set the Host that will do the mail host. $mail->Port = 587; $mail->SMTPAuth = true; // turn on SMTP authentication. Not normally needed for localhost $mail->Username = "[email protected]"; // SMTP username $mail->Password = "hispassword"; // SMTP password $mail->From = $txtSender; // Set who the mail is being sent from. This is like mail.from := value; in delphi $mail->FromName = "His Company"; // Set the name of the sender $mail->AddAddress("[email protected]"); $mail->WordWrap = 100; // set word wrap to 100 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(false); // set email format to HTML $mail->Subject = "Billing Information"; $mail->Body = "*********************************************************************************"."\n"; $mail->Body .= "Program: ".$Program."\n"; $mail->Body .= "EmailAddress: ".$EmailAddress."\n"; $mail->Body .= "CompanyName: ".$CompanyName."\n"; $mail->Body .= "CompanyAddress: ".$CompanyAddress."\n"; $mail->Body .= "City: ".$City."\n"; $mail->Body .= "StateOrProv: ".$StateOrProv."\n"; $mail->Body .= "ZipCode: ".$ZipCode."\n"; $mail->Body .= "Attention: ".$Attention."\n"; $mail->Body .= "POnumber: ".$POnumber."\n"; // $mail->AltBody = "This is the body in plain text for non-HTML mail clients"; // Now attempt to send to softech address if (@$mail->Send()) { $isMailedToSoftech = True; } else { // Set as failed and store error message $isMailedToSoftech = False; $ErrorMailMsg = $mail->ErrorInfo; // Now let's attempt to send to via the locahost since it failed. $mail->Host = "localhost"; $mail->Port = 25; $mail->SMTPAuth = false; // turn off SMTP authentication. Not normally needed for localhost $mail->Body .= "\n"; $mail->Body .= "NOTE: mail.hisdomain.com mail server failed... emailed via mail.hisdomain.com\n"; // Now physically send. if ($mail->Send()) { $isMailedToSoftech = True; } else { $isMailedToSoftech = False; $ErrorMailMsg = $mail->ErrorInfo; } } // If we successfully emailed softech, now let's email prospect. if ($isMailedToSoftech) { $mail = new PHPMailer(); $mail->IsSMTP(); // This tells us we are going to use SMTP for the mail type $mail->Host = "mail.hisdomain.com"; // Set the Host that will do the mail host. $mail->SMTPAuth = true; // turn on SMTP authentication. Not normally needed for localhost $mail->Username = "[email protected]"; // SMTP username $mail->Password = "hispassword"; // SMTP password $mail->From = $txtSender; // Set who the mail is being sent from. This is like mail.from := value; in delphi $mail->FromName = "His Company"; // Set the name of the sender $mail->AddAddress($EmailAddress); $mail->WordWrap = 100; // set word wrap to 100 characters //$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments //$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name $mail->IsHTML(false); // set email format to HTML // This is the chosen text depending on the download type $mail->Subject = $Program." - Download Instructions"; $mail->Body .= "Thank you for requesting our newest ".$Program." program ..."."\n"; $mail->Body .= "\n"; $mail->Body .= "Your new program installs in seconds and is very easy to use!"."\n"; $mail->Body .= "\n"; $mail->Body .= "1. Please be sure you have viewed one of the online animated demos!"."\n"; $mail->Body .= "\n"; $mail->Body .= "2. Visit: ".$DownloadURL." to download your installation file."."\n"; $mail->Body .= "\n"; $mail->Body .= "3. Follow the simple instructions carefully..."."\n"; $mail->Body .= "\n"; $mail->Body .= "DOWNLOAD INFO:"."\n"; $mail->Body .= " Your user name : ".$UserName." (lower case, no spaces)"."\n"; $mail->Body .= " Your password : ".$UserPassword." (lower case, no spaces)"."\n"; $mail->Body .= " Site authorization : ".$SiteAuthorization."\n"; $mail->Body .= "\n"; $mail->Body .= "Thank you again for requesting our ".$Program." program! Please let"."\n"; $mail->Body .= "us know if you have any questions!"."\n"; $mail->Body .= "\n"; $mail->Body .= "His Name"."\n"; $mail->Body .= "Sales & Support Staff"."\n"; $mail->Body .= "His Company"."\n"; if (@$mail->Send()) { $isMailedToProspect = True; } else { // Set as failed and store error message $isMailedToProspect = False; $ErrorMailMsg = $mail->ErrorInfo; // Now let's attempt to send to via the locahost since it failed. $mail->Host = "localhost"; $mail->SMTPAuth = false; // turn off SMTP authentication. Not normally needed for localhost // Now physically send. if ($mail->Send()) { $isMailedToProspect = True; } else { $isMailedToProspect = False; $ErrorMailMsg = $mail->ErrorInfo; } } } ?>[/PHP]
Basically the script tries to send out email via his mail.hisdomain.com and if it fails it tries the local host as a backup.
I will try to hard code IP next instead of by dns name for hisdomain and see if it works.
Greg