My host doesn't support PHP mail() so I am looking for a PHP mailer.

I have of course come across PHPMailer and Swift Mailer and a couple of others but was hoping there was an alternative that didn't need 34 includes, 145 languages support, and thousands of thousands of lines of code to support every possible feature that anyone might want.

Is there any more minimal PHP mailers out there that maintained similar features to PHP mail() and remote SMTP support?

  • 1
    I'm wrote my own implementation of the mail() command about 15 years ago (still using it in some places), working directly on socket level. Fully "syntax compatible" to PHP's own. Just a ~9k "library" file with no dependencies. It was part of phpGroupware then. Can't find it in its latest (2012) code, and never published it separately – but if that would be what you need, I could put it into a Gist, for example. – Izzy Oct 26 '17 at 7:21
  • PS: Just found another SMTP class in the sources of ownCloud v7 (in "thirdparty") which additionally supports TLS. It's also a "stand-alone class". Strangely, it seems no longer there with oC 9 (looks like it got rewritten and now has dependencies). – Izzy Oct 26 '17 at 9:12
  • Please share, Izzy. You never fail to impress me :-) – Mawg says reinstate Monica Oct 26 '17 at 13:18
  • Thanks @Izzy, both options sound interesting. – johna Oct 26 '17 at 20:30
  • 1
    Actually, the OC one was taken from PHPMailer. Looks like it still has no dependencies and can be used directly, so you could give it a try: smtp.php. Though from a quick glance I could not figure how to easily use that (check the examples). My class on the other hand is easy to deal with: Instantiate it with the server parameters, the call the smail() method as you would call mail(). Here's the version from 2003, would need minor adjusts for PHP7 (__construnct()). – Izzy Oct 26 '17 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.