Using a remote SMTP server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mip
Forum Newbie
Posts: 3
Joined: Wed Sep 27, 2006 3:45 am

Using a remote SMTP server

Post by mip »

I'm disabling sendmail on one of my servers and I'd like all the PHP applications I have running on that server to use an alternative server for sending mail. I've found the following in php.ini but it appears as though specifying a remote SMTP server only works on Windows (I'm using Linux and Apache).

Code: Select all

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = me@localhost.com

; For Unix only.  You may supply arguments as well (default: 'sendmail -t -i').
;sendmail_path =
How can I get all my PHP allications to use a remote mail server?
User avatar
Obadiah
Forum Regular
Posts: 580
Joined: Mon Jul 31, 2006 9:13 am
Location: Ashland, KY
Contact:

Post by Obadiah »

i dunno if this is what your looking for exactly but will something like this type of setup work for ya?

Code: Select all

[mail function]
SMTP = smtp.isp.net
sendmail_from = me@isp.net
i found it here http://email.about.com/cs/phpemailtips/qt/et021802.htm
mip
Forum Newbie
Posts: 3
Joined: Wed Sep 27, 2006 3:45 am

Post by mip »

Obadiah wrote:i dunno if this is what your looking for exactly but will something like this type of setup work for ya?

Code: Select all

[mail function]
SMTP = smtp.isp.net
sendmail_from = me@isp.net
i found it here http://email.about.com/cs/phpemailtips/qt/et021802.htm
Yes that's the sort of thing I was hoping for but it appears to only work on Win32. Can anyone prove me wrong? Does the above work on Unix?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Linux ignores the SMTP directive in the ini since almost all *nix systems have sendmail installed. There are mailer libraries available such as Swift Mailer though.
mip
Forum Newbie
Posts: 3
Joined: Wed Sep 27, 2006 3:45 am

Post by mip »

d11wtq wrote:Linux ignores the SMTP directive in the ini since almost all *nix systems have sendmail installed. There are mailer libraries available such as Swift Mailer though.
This is the conclusion I've come to. A shame the SMTP directive is igored. I'm now going to have to change all my applications.
Post Reply