Weird bug using xamp and phpmailer

So i have phpmailer in my website , it’s working properly but i’m experiencing a weird bug when i put attachments into the mail if i put a 24kb attatchment , when this code has to be executed , the browser hangs , trying to load localhost (xamp website) and i can’t actually enter the website it hangs on “connecting” i’ve tried attaching 0kb files to the email and it works so im guessing this has to do with the PDF File i’m trying to attach rather than with the code , anyway , this is what im doing :
require_once(“../../phpmailer/PHPMailerAutoload.php”);

$mail = new PHPMailer;

// Debug para ver errores 
$mail->SMTPDebug = 3;                               
//hacemos que  PHPMailer use SMTP.
$mail->isSMTP();            
//direccion                          
$mail->Host = "smtp.gmail.com";
//poner verdadero para requerir autorizacion
$mail->SMTPAuth = true;                          
//Usuario y contraseña   
$mail->Username = "rakall66@gmail.com";                 
$mail->Password = "****";                           
//If SMTP requires TLS encryption then set it
$mail->SMTPSecure = "tls";                           
//Set TCP port to connect to 
$mail->Port = 587;                                   

$mail->From = "rakall66@gmail.com";
$mail->FromName = "No responder - Informacion Pago";
$receptor="testingfield1@hotmail.com";
$mail->addAddress($receptor, "El que recibe");

$mail->isHTML(true);

$mail->Subject = "Pago en Vidya";
$mail->Body = "<i>Usted ".$login_session."  ha realizado un pago en Vidya </i>";
$mail->AltBody = "Version en texto plano";
$mail->AddAttachment("../../facturas/factura.pdf","nombre");
//$mail->AddAttachment("../../facturas/factura.pdf","nombre");
if(!$mail->send()) 
{
    echo "Mailer Error: " . $mail->ErrorInfo;
} 
else 
{
    echo " error";
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s