breaststroke
Programmer
Hello, I would really appreciate if I get some help on the following problem:
I have a script for sending emails through phpmailer.
I have tried changing several things, such us username and password of my mail server, limit at the SQL query, etc. After those changes I usually manage to send some emails, but always after a couple days the script stop working.
I am not being able to figure out where the problem lies, since it seems that doing the same changes it is not enought to make it work.
This is my script:
The error I am getting now is the following:
"Mailer Error: Language string failed to load: connect_host"
,although I would swear I got different errors in previous occasions.
Thank you very much in advance!!
My regards
enjoy practicing languages at:
I have a script for sending emails through phpmailer.
I have tried changing several things, such us username and password of my mail server, limit at the SQL query, etc. After those changes I usually manage to send some emails, but always after a couple days the script stop working.
I am not being able to figure out where the problem lies, since it seems that doing the same changes it is not enought to make it work.
This is my script:
Code:
..
include('conexioninclude.php');
mysql_set_charset('utf8');
$registros=mysql_query("SELECT password,mail,name,code,time FROM table WHERE registration= '0'
AND review !='no' limit 2",$conexion)or
die("Problems with select:".mysql_error());
while($reg=mysql_fetch_array($registros))
{
$code=$reg['code'];
$namename=$reg['name'];
$mailmail=$reg['mail'];
$password=$reg['password'];
$time=$reg['time'];
$timerightnow=time();
$dif=($timerightnow-$time);
if($dif>80000)
{
require_once("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Port = xxxxxxx;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->Username = "xxxxxxx";
$mail->Password = "xxxxxxxx"; // SMTP password
$webmaster_email = "xxxxxxx"; //Reply to this email ID
$email="xxxxxxxxx"; // Recipients email ID
$name="Admin"; // Recipient's name
$mail->From = "xxxxxxxx";
$mail->FromName = "xxxxxxxx";
$mail->AddAddress($mailmail,$namename);
$mail->AddReplyTo($webmaster,"Webmaster");
$mail->WordWrap = 50; // set
$mail->IsHTML(true); // send as HTML
$mail->Subject = "test";
$foto= "public_html/foto.jpg";
$mensaje='<img src="'.$foto.'" \><br /><br />
xxxxxxxxx';
$mail->MsgHTML($mensaje);
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "fine";
}
}
}
..
The error I am getting now is the following:
"Mailer Error: Language string failed to load: connect_host"
,although I would swear I got different errors in previous occasions.
Thank you very much in advance!!
My regards
enjoy practicing languages at: