Ver Mensaje Individual
  #5 (permalink)  
Antiguo 07/10/2015, 15:48
franjgg
 
Fecha de Ingreso: marzo-2007
Mensajes: 751
Antigüedad: 17 años, 1 mes
Puntos: 4
Respuesta: Envio de envio con PHPMailer va al spam

No entiendo muy bien a que configuración, este es parte del código que uso:

Código PHP:
Ver original
  1. $mail = new PHPMailer();
  2.  
  3.  
  4.             $subj = 'Video';  
  5.  
  6.  
  7.             $body = 'Fecha '.date('d/m/Y', strtotime($fecha)).'<br><br>';
  8.  
  9.             $body .='<a href="'.$_POST['url_video'].'">'.$_POST['url_video'].'</a>';              
  10.                                
  11.  
  12.  
  13.             $mail->SMTPDebug = 2;
  14.             //Ask for HTML-friendly debug output
  15.             $mail->Debugoutput = 'html';
  16.             //Set the hostname of the mail server
  17.             $mail->Host = 'smtp.gmail.com';
  18.             //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
  19.             $mail->Port = 587;
  20.             //Set the encryption system to use - ssl (deprecated) or tls
  21.  
  22.             $mail->IsSendmail();
  23.             $mail->SMTPSecure = 'tls';
  24.             //Whether to use SMTP authentication
  25.             $mail->SMTPAuth = true;
  26.             //Username to use for SMTP authentication - use full email address for gmail
  27.             $mail->Username = "[email protected]";
  28.             //Password to use for SMTP authentication
  29.             $mail->Password = "xxxxxx";
  30.             //Set who the message is to be sent from
  31.             $mail->setFrom('info@'.$_SESSION['nombre'].'.com', ''.$_SESSION['nombre'].'');
  32.             //Set an alternative reply-to address
  33.             $mail->addReplyTo('info@'.$_SESSION['nombre'].'.com', ''.$_SESSION['nombre'].'');
  34.             //Set who the message is to be sent to
  35.             $mail->addAddress('[email protected]', ''.$_SESSION['nombre'].'');
  36.             //Set the subject line
  37.             $mail->Subject = $subj;
  38.             //Read an HTML message body from an external file, convert referenced images to embedded,
  39.             //convert HTML into a basic plain-text alternative body
  40.             $mail->msgHTML($body);
  41.             //Replace the plain text body with one created manually
  42.             $mail->AltBody = $body;
  43.             //Attach an image file
  44.             //$mail->addAttachment('images/phpmailer_mini.gif');
  45.  
  46.             //send the message, check for errors
  47.             if (!$mail->send()) {
  48.                 echo "Mailer Error: " . $mail->ErrorInfo;
  49.             } else {
  50.  
  51.             }