[wp-hackers] Adding phpmailer options (smtp for example)
lists.automattic.com at callum-macdonald.com
Fri Aug 31 12:49:46 GMT 2007
I hadn't noticed the filter, but you're absolutely right, that would be
called at the right point and would most likely work (I haven't tested
it yet). I might well rework my plugin to use that approach. I'll
probably do that when I add the option page.
Thanks for the feedback.
Cheers - Callum.
Peter Westwood wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> Callum Macdonald wrote:
>> Ok, I've whipped up a plugin. It's a copy of the original wp_mail()
>> function but it adds SMTP by default (to localhost) and a couple of
>> other config options. They're currently only configurable within the
>> file itself, but if it's a popular plugin I'll be happy to add an
>> Options page to make it easier to configure.
>> Any feedback would be much appreciated.
> Nice plugin.
> But it misses on the simplicity of the task in hand.
> This is actually all you need:
> * Plugin Name: pjw-wp-mail-smtp
> * Version: 0.1
> * Plugin URI: http://blog.ftwr.co.uk/wordpress/
> * Description: Get PHPMailer to use smtp not mail()
> * Author: Peter Westwood
> * Author URI: http://blog.ftwr.co.uk/
> * */
> function pjw_phpmailer_init($php_mailer)
> $php_mailer->Mailer = 'smtp';
> $php_mailer->Host = 'localhost';
> The hook phpmailer_init is called just before ->Send in trunk and you
> can just override the few parameters and not have to replace the whole
> of wp_mail.
> Hope this helps.
> - --
> Peter Westwood
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> -----END PGP SIGNATURE-----
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers