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

Callum Macdonald lists.automattic.com at callum-macdonald.com
Thu Aug 30 14:03:09 GMT 2007


G'day,

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.
http://www.callum-macdonald.com/code/wp-mail-smtp/

Cheers,


Callum.

Moritz 'morty' Struebe wrote:
> I'm much in favor of a Plugin. For one it shouldn't be to hard to 
> write, overloading wp-mail() and because it's released much quicker 
> (I'm really looking forward to this and thought about writing it my 
> self, because I need it for my plugin). Once you have written the 
> Plugin it should be little work to integrate it into the core.
> If you need support just mail me. (I always appreciate when someone 
> tests and gives me feedback on my code)
> Cheers
> Morty
>
> DD32 wrote:
>> Being such a simple thing, I thought having it in core would be best, 
>> However, It does only affect a very small number of users, So maybe 
>> plugin would be better.
>> But should a user have to install a plugin simply to get mail working 
>> correctly because of the server configuration? Generally WP tends to 
>> try to accomodate the most users(Such as the Backwards compatibility 
>> to PHP 4.3).
>>
>>
>> On Thu, 30 Aug 2007 21:57:56 +1000, Callum Macdonald 
>> <lists.automattic.com at callum-macdonald.com> wrote:
>>
>>  
>>> 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
>>>>       
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>>>     
>>
>>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>
>>   
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>



More information about the wp-hackers mailing list