Home » Linux OS and Software » How-To » mail() php not working on VPS
Sun, 20 September 2009 22:32 Go to next message
Registered: May 2009
Messages: 6
I'm looking for a good tutorial on how to setup POSTFIX. I've got an imap server going - but I'd really like to see my postfix going for my php mail() scripts.

Tue, 16 February 2010 20:16 Go to previous message
Registered: May 2009
Messages: 21
As default, PHP's mail() function uses local sendmail command, unlike in Windows, where you MUST specify an SMTP host.

Since you have postfix running, it replaces the sendmail command with its own hook script. I run it in openSUSE 11.0 just fine.

I hope you started postfix with "rcpostfix start" or "service postfix start", depending on your distro, and made Postfix run at startup.

This should suffice. Are you sure that Postfix is not sending email? Do you have any log trace or PHP error about it?

Anyway, to use SMTP follow this http://email.about.com/od/emailprogrammingtips/qt/Configure_ PHP_to_Use_a_Remote_SMTP_Server_for_Sending_Mail.htm and set localhost as SMTP server.

But I would prefer you tell me if you are sure Postfix is NOT sending email for you.

Try to create a PHP script that sends a message to a very well known address, and check spam folder!
From shell, you can try the following:

$ sendmail
From: <sender@email.address>
To: <recipient@email.address>
Subject: test

Test body
without forgetting the final "breakline-dot-breakline" I mentioned.
Previous Topic:install svn on Centos 5
Next Topic:Setup Subdomain?
Goto Forum:

Current Time: Tue Oct 23 06:31:20 EDT 2018
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2006 FUD Forum Bulletin Board Software