[wp-hackers] Adding phpmailer options (smtp for example)

Callum Macdonald lists.automattic.com at callum-macdonald.com
Thu Aug 30 11:57:56 GMT 2007


G'day,

It would be possible to add it as a plugin. The change is only 2-4 lines 
of code though, you simply comment out one line and add another 2 (4 if 
you're using SMTP auth). I figured it would make sense to make it 
available to all users rather than offering it as an add on.

However, happy to go with the consensus. So far I count +2 for a plugin. 
Omry, do you have a view on it? Anyone else?

Cheers,


Callum.

Peter Westwood wrote:
>
> On 29 Aug 2007, at 23:46, Callum Macdonald wrote:
>
>> One of our sites had an issue today where it was dying with the error:
>> The e-mail could not be sent.
>> Possible reason: your host may have disabled the mail() function...
>>
>> Investigating, I realise that phpmailer is bundled with WordPress and 
>> it's configured to use PHP's mail() function by default. That seems 
>> sensible, however, I think it would be useful to add some options to 
>> allow the user to configure it's use. For example, to send mail by 
>> SMTP and then specify a host (even a username/password).
>>
>> Before I bash out some code and send a patch, I thought I'd ask for 
>> feedback. Can anyone see any flaws in this plan? Would the options be 
>> best implemented in the options database? Which admin screen would be 
>> most relevant? If the user specifies an invalid server, how will that 
>> affect the system? Is that more or less likely than mail() being 
>> disabled?
>>
>> I think the current default is sensible, but options would be useful. 
>> If I don't hear anything in the next few days I'll write some code 
>> anyway and we can take it from there.
>
> I don't think this kind of configuration is needed for 90% of users. 
> Therefore it would be better as a plugin.
> I would suggest you try and write a plugin to achieve what you require.
> If you find you need extra actions/filters in WordPress in order to 
> achieve the functionality within the plugin then let us know (tickets 
> in trac) and I am sure they will be added.
>
> Cheers
>
> westi



More information about the wp-hackers mailing list