PHPMailer prints unwanted error info.

  • vision
  • Beginner
  • Beginner
  • User avatar
  • Posts: 57
  • Loc: Maryland

Post 3+ Months Ago

Anyone have experience with PHPMailer?

I have been using it for years and only now come up with an issue.

If I attempt to send a message through an SMTP server that is down, I can trap the issue and handle the situation.

Unfortunately when that happens PHPMailer will print the following:

SMTP Error: Could not connect to SMTP host.

Even if debugging is disabled it will still print the message. I want to handle the error condition myself, I don't want the class printing out the fact that there was an error.

I tracked the issue to line 586 of class.phpmailer.php which is printing the message (version 5.1 of the library).

Other than removing the line does anyone know a work around?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

Does the class have a debug mode you can set/disable? If so just take advantage of it and wrap the statmenr in a condition to only display when in debug.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 151 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.