Pekus
Pekus

Reputation: 155

How send email from PHPMAILER without SMTP

Can anyone tell me, how send email from PHPMailer not using SMTP? This class includes the method isMail() and it should send an email using the mail() function instead SMTP. I'm use Xaamp. When I use SMTP server it's not working all.

My code:

$mail=new PHPMailer();
$mail->IsMail();
$mail->From = '[email protected]';
$body = "Test body message";
$mail->AddAddress("[email protected]", "John Doe");
$mail->Subject = "PHPMailer Test Subject via mail(), basic";
$mail->MsgHTML($body);

if(!$mail->Send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo "Message sent!";
}

Send Method returns true and displays message that email has been sent?

Upvotes: 2

Views: 6195

Answers (1)

Jilu
Jilu

Reputation: 197

The topic is old but for those who will read this. Try to replace

$mail->isSMTP();

by

$mail->isSendMail();

Upvotes: 2

Related Questions