Discussion:
setup postfix server and configure php to use it via php.ini for email
(too old to reply)
Ronald Cross
2006-12-20 22:23:07 UTC
Permalink
Hi all, this is my first post and if I am posting on the wrong list,
please direct me to the correct list.

I am trying to setup a postfix server and configure php to use it via
php.ini for email.

I am doing this on an Intel Imac machine and postfix is already built
into the OS.

What do I need to do to accomplish this setup?

I have looked at the code inside php.ini and see the following:

start of code:

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

; For Win32 only.
;sendmail_from = ***@example.com

; For Unix only. You may supply arguments as well (default:
"sendmail -t -i").
;sendmail_path =

end of code

how do I modify this so that it works with postfix?

with warm regards
RLC
Michael Wang
2006-12-21 01:26:20 UTC
Permalink
Post by Ronald Cross
Hi all, this is my first post and if I am posting on the wrong list,
please direct me to the correct list.
I am trying to setup a postfix server and configure php to use it via
php.ini for email.
I am doing this on an Intel Imac machine and postfix is already built
into the OS.
What do I need to do to accomplish this setup?
I haven't used that combo on OS X before but assuming the Postfix
sendmail executable is installed it should just work, though you may
need to specify a path to it in the php.ini file if Apple puts it in a
non-standard location.

Have you tried writing a test PHP page using the mail() function?
--
Michael Wang
MrC
2006-12-21 01:30:40 UTC
Permalink
Post by Ronald Cross
Post by Ronald Cross
I am trying to setup a postfix server and configure php to
use it via
Post by Ronald Cross
php.ini for email.
I am doing this on an Intel Imac machine and postfix is
already built
Post by Ronald Cross
into the OS.
What do I need to do to accomplish this setup?
I haven't used that combo on OS X before but assuming the
Postfix sendmail executable is installed it should just work,
though you may need to specify a path to it in the php.ini
file if Apple puts it in a non-standard location.
Have you tried writing a test PHP page using the mail() function?
With a standard postix install, the line in:

/etc/php.ini

sendmail_path = /usr/sbin/sendmail -t -I

works fine.

MrC
Victor Duchovni
2006-12-21 02:25:21 UTC
Permalink
Post by MrC
Post by Michael Wang
I haven't used that combo on OS X before but assuming the
Postfix sendmail executable is installed it should just work,
though you may need to specify a path to it in the php.ini
file if Apple puts it in a non-standard location.
Have you tried writing a test PHP page using the mail() function?
/etc/php.ini
sendmail_path = /usr/sbin/sendmail -t -I
I doubt that "-I" (upper-case) is the flag you had in mind...
--
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:***@postfix.org?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
'MrC'
2006-12-21 02:39:56 UTC
Permalink
Post by Michael Wang
Post by MrC
Post by Michael Wang
I haven't used that combo on OS X before but assuming the Postfix
sendmail executable is installed it should just work,
though you may
Post by MrC
Post by Michael Wang
need to specify a path to it in the php.ini file if Apple
puts it in
Post by MrC
Post by Michael Wang
a non-standard location.
Have you tried writing a test PHP page using the mail() function?
/etc/php.ini
sendmail_path = /usr/sbin/sendmail -t -I
I doubt that "-I" (upper-case) is the flag you had in mind...
No, of course not. But Outlook thinks it knows better than you and I, with
its oh-so-annoying tendency to auto-capitalize.

Note to self - turn that darned *feature* off.

Thanks,
MrC

Michael Wang
2006-12-21 02:31:32 UTC
Permalink
I have specified the path in sendmail_path=/usr/sbin/sendmail
My issue is that I need the email to be sent through port 587 instead of
port 25 because my ISP blocks port 25.
Somebody else will need to help you with that part, I'm not sure how to
do that myself.
How do I write a test PHP page using the mail() function?
It just needs to look something like:

<?php

mail("***@example.com", "My Subject", "Testing");

?>

And then either run it through the PHP CLI if it's installed or make it
a PHP Web page and put it somewhere where you Web server can serve it up
(but remove it when you are done testing so nobody stumbles across it).
The above example doesn't put in a From: line so it will look a bit odd.
Read the PHP documentation on the mail() function if you want to add
additional headers to the message.
--
Michael Wang
Loading...