-1
I have the code to follow:
require_once('c:\wamp64\www\phpmailer\class.phpmailer.php');
$mail = New PHPMailer();
//$mail-> ErrorInfo;
//exit;
$mail->IsSMTP = true;
//$mail-> ErrorInfo;
//exit;
$mail->SMTPSecure = "ssl";
//$mail-> ErrorInfo;
//exit;
$mail->Host = "smtp.host.com.br";
//$mail-> ErrorInfo;
//exit;
$mail->Port = 465;
//$mail-> ErrorInfo;
//exit;
$mail->Username = "[email protected]";
$mail->Password = "senha123";
//$mail-> ErrorInfo;
//exit;
$mail->From = "[email protected]";
$mail->FromName = "Suporte";
//$mail-> ErrorInfo;
//exit;
$mail->Subject = "Teste de Envio";
$html = "aa !";
$text = "aa ! ";
$mail->Body = $html;
$mail->AltBody = $text;
//$mail-> ErrorInfo;
//exit;
$mail->AddAddress("[email protected]", "suporte");
//$mail-> ErrorInfo;
//exit;
if (!$mail->Send()){
echo "Erro DNOVO !".$mail->ErrorInfo;
} else {
echo "ALELUIA DEU CERTO !";
}
It returns the following error:
Erro DNOVO !Could not instantiate mail function.
Would not be
$mail->isSMTP()
in place of$mail->isSMTP = true
?– Woss
I use it like this:
require_once '../../lib/phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer;
– MarceloBoni
include(SMTP.php): failed to open stream: No such file or directory appeared when I tried to switch to issmtp();
– rods
i tried switching to phpmailerautoload.php and continues with the same error
– rods
@Rods, you have in your project the file
class.smtp.php
that is part of thePHPMailer
?– Woss
Yeah, I got it from my friend down there, but thanks!
– rods