Skip to content

phpMailer – Could not instantiate mail function

Had a client getting this error when trying to send emails last week and have now spent several hours on Google trying to find a solution.

Biggest catch is that other scripts were able to send mail, so it seemed unlikely that it was the host. So I took the phpMailer class and uploaded it to a test folder and wrote a script that did pretty much exactly what ProofBuddy does and it worked just like it should.

After much confusion on my part, I discovered a typo in the email address that was used for sending. A character was left out – exampl.com instead of example.com. Guess 1&1 had something in place that checked if it was a valid domain before sending out.

I’m sure there’s a lesson in there somewhere. Either way, I’m glad it wound up being something relatively simple even if it did take me way too long to get there.

Published inProgramming

Be First to Comment

Leave a Reply

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