PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Nov 16, 2018 4:16 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: php and postfix
PostPosted: Thu Oct 22, 2009 12:41 pm 
Offline
Forum Newbie

Joined: Thu Oct 22, 2009 12:39 pm
Posts: 1
Hello, I am using PHP and trying to send an email from within the PHP script using the mail() function. This is PHP 5.2.4 and Ubuntu Hardy Heron. I am just trying to send the email to myself to check whether this works. The PHP script does not generate any error and the return value for the mail() function is TRUE, but the email does not arrive.

I had sendmail installed originally but read that people have had better luck with postfix, so I installed that. Postfix seems to be working from what I can tell. I can do

telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 homemade ESMTP Postfix (Ubuntu)
ehlo localhost
250-homemade
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

But the email is still not received from the PHP script. The problem may be in the php.ini file. These are the relevant settings:

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

; For Win32 only.
;sendmail_from = anyone@anyone.com

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

Thanks for any help you can give.


Top
 Profile  
 
 Post subject: Re: php and postfix
PostPosted: Fri Oct 30, 2009 10:42 pm 
Offline
Forum Newbie

Joined: Fri Oct 30, 2009 8:58 pm
Posts: 3
I recently had to setup a ubuntu server with postfix and it took me 4ever :)
I was using 9.04 Jaunty Jack I think...

First you need to comment these two lines out like so (settings only for Windows):
;SMTP = localhost
;smtp_port = 25

Tons of good info HERE


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group