Hola como andan, yo lidiando con phpmailer, que funciona ok los envíos usando el smtp de gmail, pero el problema lo tengo en la bcc que me corta el envío al poner vs direcciones adonde llega la lista de precios de los clientes.
Si tengo un espacio, un salto de línea o un correo con algún - o . se corta el envío
Código PHP:
<?php
require("class.phpmailer.php");
if ($_POST['action'] == "send") {
$varname = $_FILES['archivo']['name'];
$vartemp = $_FILES['archivo']['tmp_name'];
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]";
$mail->Password = "xxx";
$mail->From = "[email protected]";
$mail->FromName = "[email protected]";
$mail->Subject = $_POST['asunto'];
$mail->AddAddress($_POST['destino']);
}
if($_POST['mensaje1']){
$sa = explode(",",$_POST['mensaje1']);
foreach($sa as $mensaje1){
$mail->AddBCC($mensaje1);
}
if ($varname != "") {
$mail->AddAttachment($vartemp, $varname);
}
$body = "<strong>Mensaje</strong><br><br>";
$body.= $_POST['mensaje']."<br>";
$body.= "<i>Enviado por </i></p>
<p><i>Si no desea recibir mas información, responda este correo con asunto ELIMINAR.</i>
</p>";
$mail->Body = $body;
$mail->IsHTML(true);
$mail->Send();
}
echo "su mensaje ha sido enviado satisfactoriamente";
?>
Código:
<p align="center">BBC (Copia Oculta)
<textarea name="mensaje1" cols="100" rows="100"></textarea>
</p>