Page 1 of 1

Config PHP for SMTP authentication? Need chapter&verse

PostPosted: 23. August 2004 02:51
by mengland
Hi,

I want to setup up my Windows-based web server (which is hosting phpBB and other php-based server apps) to send it's email through php's mail() function. This allows me to set the SMTP settings in one place on my php-based server, instead of having to configure the smtp settings in all my php-bases server apps (duplication config info, takes more time, error prone, etc).

Unfortunately, I need to be able to use an SMTP server that requires login/password authentication. PHP's 4.x mail() function does not support this. Basically, php.ini has this:

[mail function]
; For Win32 only.
SMTP = <put in smtp server here>

...and nothing else.

Options I'm investigating:

* I understand pear (?) has a means for smtp authentication; I apparently have pear on my system (XAMPP 1.4.5 based). I don't know how to configure this.

* I can use PHPMailer. I see tutorials at http://phpmailer.sourceforge.net/tutorial.html ...but these seem to talk about coding a particular program to send email. I just want to override/overload my php.mail() function to implicitly handle SMTP authentication...which I understand phpmailer can do...I just don't know the steps to set this up! I'm looking for "chapter and verse" instructions from the start of downloading phpmailer and going from there. I have yet to find this in the phpmailer stuff.

Can this forum help give this rookie (me) some directions?

-Matt

PostPosted: 23. August 2004 03:15
by mengland
Fyi: I have this discussion going on at:
http://www.phpbb.com/phpBB/viewtopic.php?p=1213622 ...


geocator wrote:The phpmailer that you are reffering to is a class to use in your own php scripts to add SMTP functions to them. You still have to set it on a script by script basis.


Thanks for all this info.
Can I setup a php script that runs in a "global" context to override php.mail()?

The other option would be to install a SMTP server on the webserver and set it to only accept mail from itself and then use localhost with no authentication.


Ok. Seems like I would need the localhost-based smtp server to relay to the SMTP server for which I'm trying to connect to via php.mail(). Is this feasible? Any points on how to set this up automatically in my XAMPP-based system? (Fyi: I have a thread going on XAMPP-for-windows forum.)

-Matt