PHPMailer will not send out mail. I get an error with PHPMailer.

Question:

Using PHPMailer, I get errors when sending out mail. Any ideas?

Answer:

If you have code like :

$mail->IsSMTP();

and

$mail->Host = "localhost";

in your code. Change it to:

$mail->IsSendmail();

The IsSMTP() call tells PHPMailer to send via your local SMTP server. However in most cases this will not work with-out authenticating yourself. You can use PHPMailer to also do an auth but if you are sending to an SMTP server on the local server (ie. “localhost”) – it is much better to do this via sendmail directly. The call to :

$mail->IsSendmail();

tells PHPMailer to do this.

Leave a Reply

Your email address will not be published. Required fields are marked *