I'm using the phpmailer function, follow the settings:
$file = str_replace($comacento, $acentohtml, $file);
require_once('../phpmailer/class.phpmailer.php');
require_once('../phpmailer/class.pop3.php'); // required for POP before SMTP
require_once('../phpmailer/class.smtp.php');
$mail = new PHPMailer(); // the true param means it will throw exceptions on errors, which we need to catch
$mail->CharSet = 'UTF-8';
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.catalogovirtualnossacasa.com.br"; // SMTP server
$mail->SMTPSecure = "tls";
$mail->SMTPDebug = 1; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMPTAuth = true; // enable SMTP authentication
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // SMTP account username
$mail->Password = "******"; // SMTP account password
$mail->SetFrom($_POST['email'], $_POST['nome']);
$mail->AddReplyTo($_POST['email'], $_POST['nome']);
$mail->Subject = 'loja '.$_POST['email'].' & Grupo Nossa Casa ';
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($file);
$mail->isHTML(true);
$mail->AddAddress($_POST['email'], "Compra - Grupo Nossa Casa");
if($mail->Send()){
echo "
<script type=\"text/javascript\">
alert(\"ok!\");
</script>";
}
else{
echo "
<script type=\"text/javascript\">
alert(\"deu ruim\");
</script>";
}
displays the following error:
Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /var/sentora/hostdata/gnc/public_html/adm_catalogovirtualnossacasa_com_br/phpmailer/class.smtp.php on line 248
SMTP -> ERROR: RSET failed: KGA�rh�� OkA4O��#��:8f�F,ol� Xe[�q�����Q�*&p�z��n�DL��03l��cZ���q_�G�_���i��2rJ�v.�A�WV��hR�^�3g7~k"+A�&���>Jx���'ߦ̈y�/�Q����J�s����1-{o�����+#�6M� �C�pKſ4�*3@Y�M1l�jJ@@!'�L9�q��\~���s<�;��[�u�Q����l���'I\"�J�d}]����@�q�Q�'�>���=��<�τ�I5kVe� ����cu� ;����y?B�ל �/L&���W��%:�����[S
SMTP -> NOTICE: EOF caught while checking if connectedThe following From address failed: [email protected]