PhpMailer error sending

0

Oops, I'm using a phpmailer's own email function, it follows function

function SendMail($acessa_arquivo, $email_destinatario, $nome_destinatario, $assunto, $mensagem, $link)
{

    require_once("_files_itens/PHPMailer/PHPMailerAutoload.php");




    $mail = new PHPMailer;
    //$mail->SMTPDebug = 3; 

    $mail->IsMAIL();

    $mail->Host = 'mail.site.com.br'; 
    $mail->SMTPAuth = true; 
    $mail->Username = '[email protected]';
    $mail->Password = '**********';      
    $mail->Port = 587; 
    $mail->setFrom('[email protected]', 'site');
    $mail->addAddress($email_destinatario, $nome_destinatario);
    $mail->isHTML(true);  
    $mail->Subject = $assunto;
    $mail->Body    = $mensagem;
    $mail->AltBody = $mensagem;


        if(!$mail->send()) {
            echo 'OOOO.';
            echo 'Mailer Error: ' . $mail->ErrorInfo;
        } else {
            echo 'Mensagem Enviada';
        }

}

The issue is that this function works perfectly, but by trying to reuse it on another page, I'm getting a phpmailer error, which I could not identify.

Error: Mailer Error: Could not instantiate mail function.

The recipient email is correct, the subject does not exceed 20 characters in letters.

    
asked by anonymous 20.09.2016 / 16:14

0 answers