samuelodofin Posted July 26, 2007 Share Posted July 26, 2007 Hi, i have just set up my new server, however i the mail() function on php dosnt work, i have installed postfix and configured the correct send_mail path in the php.ini .......... i just dont know whats wrong..........any help will be very much appreciated. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
steviewdr Posted July 26, 2007 Share Posted July 26, 2007 Do you have postfix running on your server? Postfix runs on your.ip.of.server:smtp (or port 25). Php uses sendmail by default. Although sendmail can send mail itself, if postfix is already running on port 25, then sendmail uses postfix to send emails. Put your php.ini back to default, i.e. sendmail. Try sending a mail via mail(). Check your postifx logs, i.e. /var/log/mail.info or mail.log. Also, does your ISP allow outgoing smtp (25). Test this by going on your server/computer: telnet mail.skynet.ie 25 -steve Quote Link to comment Share on other sites More sharing options...
samuelodofin Posted July 26, 2007 Author Share Posted July 26, 2007 hy steve, thnx for the reply, i have restored the php.ini back to default and tried the mail() again, but it just wont work .... i also tested to see if my ISP allows outgoing smtp (25) and it does, got a positive result...but the mail() still not working. do you have any idea of anything else i might be missing.........because i tried sending an email over ssh to myself and it came!... Quote Link to comment Share on other sites More sharing options...
steviewdr Posted July 26, 2007 Share Posted July 26, 2007 First off, here is my spiel on sendmail: http://wiki.kartbuilding.net/index.php/Sendmail Secondly, is this your server? or did your hosting company setup this system? If so, they could have done any number of things to stop php from sending mail. Check for permissions on mail spools and sendmail. You can get a PHP script which will send emails directly!! I.e. open up a socket and sent it all together. This will definately work. There is a good tutorial on phpfreaks for this. Also, check with a phpinfo() where sendmail is. Is it in /usr/bin/sendmail ? Does this exist on the server? Try the php mail script (you should be able to google it no probs) and see. It'll definately work. -steve Quote Link to comment Share on other sites More sharing options...
samuelodofin Posted July 30, 2007 Author Share Posted July 30, 2007 Hi steve, thanks for your help, i am usuing postfix instead of sendmail, and i am able to mail myself from /usr/sbin/sendmail.postfix .....works fine. But when i try to run my php script from ssh, it outputted these errors: /etc/postfix/main.cf: line 31: queue_directory: command not found /etc/postfix/main.cf: line 36: command_directory: command not found /etc/postfix/main.cf: line 42: daemon_directory: command not found /etc/postfix/main.cf: line 53: mail_owner: command not found /etc/postfix/main.cf: line 110: inet_interfaces: command not found /etc/postfix/main.cf: line 155: mydestination: command not found /etc/postfix/main.cf: line 212: unknown_local_recipient_reject_code: command not found /etc/postfix/main.cf: line 377: alias_maps: command not found /etc/postfix/main.cf: line 388: alias_database: command not found /etc/postfix/main.cf: line 586: debug_peer_level: command not found /etc/postfix/main.cf: line 604: debugger_command: command not found /etc/postfix/main.cf: line 606: xxgdb: command not found /etc/postfix/main.cf: line 634: sendmail_path: command not found /etc/postfix/main.cf: line 639: newaliases_path: command not found /etc/postfix/main.cf: line 644: mailq_path: command not found /etc/postfix/main.cf: line 650: setgid_group: command not found /etc/postfix/main.cf: line 654: html_directory: command not found /etc/postfix/main.cf: line 658: manpage_directory: command not found /etc/postfix/main.cf: line 663: sample_directory: command not found /etc/postfix/main.cf: line 667: readme_directory: command not found I checked and those dirs where there....so..............i duunoo....... Thanks in advance Quote Link to comment Share on other sites More sharing options...
steviewdr Posted July 30, 2007 Share Posted July 30, 2007 I suggest you read this phpfreaks tutorial: http://www.phpfreaks.com/tutorials/130/0.php -steve Quote Link to comment Share on other sites More sharing options...
samuelodofin Posted July 30, 2007 Author Share Posted July 30, 2007 Thanks steve!!!...........ure a genius, we need more of u in this world.......its working!!!!!!..................I'd give u my daughter to marry!!![joking] ....................Thnx so much... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.