rahultailwal Posted November 1, 2012 Share Posted November 1, 2012 Hi, I have a servers based on PHP Version 5.3.10-1ubuntu3.4 When i use mail function of php then my mails are not going. It is returning false. It could be server issue but i want to know what is the issue with it. What to do to fix it. I have tried to set sendmail_from in php ini. but nothing works. I tried mailer class but nothing happens. Thanks Link to comment Share on other sites More sharing options...
birbal Posted November 1, 2012 Share Posted November 1, 2012 when it returns false it means that your mail is not accepted for delivery by mail server. make sure your email data satisfy the RFC standards. check here http://php.net/mail. posting the code would be helpfull Link to comment Share on other sites More sharing options...
rahultailwal Posted November 1, 2012 Author Share Posted November 1, 2012 I just used a simple mail. like mail(to,subject,message); Its works in one server and not in this 1 Link to comment Share on other sites More sharing options...
justsomeguy Posted November 1, 2012 Share Posted November 1, 2012 Does the server have a mail server installed and configured? Link to comment Share on other sites More sharing options...
rahultailwal Posted November 2, 2012 Author Share Posted November 2, 2012 As i saw in phpinfo that looks same as in another server. There is sendmail_path, SMTP is on etc. The problem is from server configuration i guess. But i want to know what should be there to run mail server. Link to comment Share on other sites More sharing options...
birbal Posted November 2, 2012 Share Posted November 2, 2012 what you see in php info is configuration of connecting to SMTP server. what if SMTP server itself is not there? you need to check that. check your running services that SMTP server is running or not. check the sendmail path. Link to comment Share on other sites More sharing options...
rahultailwal Posted November 2, 2012 Author Share Posted November 2, 2012 SMTP localhost smtp_port 25 Path to sendmail /usr/sbin/sendmail -t -i sendmail_from no value no value sendmail_path /usr/sbin/sendmail -t -i mail.add_x_header On On mail.force_extra_parameters no value no value mail.log no value This is the phpinfo. I have tested by setting sendmail_from but didn't help. Thanks Link to comment Share on other sites More sharing options...
Ingolme Posted November 2, 2012 Share Posted November 2, 2012 Outside of PHP you need to have another application that sends mail. The sendmail path is supposed to tell PHP where it is. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 2, 2012 Share Posted November 2, 2012 Does /usr/sbin/sendmail exist? Have you checked that? Link to comment Share on other sites More sharing options...
rahultailwal Posted November 3, 2012 Author Share Posted November 3, 2012 (edited) I saw the folder is there /usr/sbin/But sendmail file or folder is not thereSendmail is server i suppose. If this is wrong then what i need to do. Edited November 3, 2012 by rahultailwal Link to comment Share on other sites More sharing options...
birbal Posted November 3, 2012 Share Posted November 3, 2012 you need to install sendmail and set up the path in php.ini to point to the sendmail binary. It is also possible that you may have already sendmail in another location, in that case you need to point to correct binary path. Link to comment Share on other sites More sharing options...
rahultailwal Posted November 5, 2012 Author Share Posted November 5, 2012 How to install sendmail. Is that my part or server administrator will do it. And if it is there then how to get that path. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 5, 2012 Share Posted November 5, 2012 How to install sendmail. Is that my part or server administrator will do it. And if it is there then how to get that path.If someone else is running your server then you should probably ask them how to send mail with PHP. You can find instructions for installing sendmail online if you search for them. Link to comment Share on other sites More sharing options...
rahultailwal Posted November 6, 2012 Author Share Posted November 6, 2012 Actually i dont have server details. Its SSL server and i dont have cpanel details. I can login using putty. Can i see something from there. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 6, 2012 Share Posted November 6, 2012 I don't know how to check for installed mail servers using a shell, I would ask your administrator what is available on your server for sending mail through PHP. Link to comment Share on other sites More sharing options...
rahultailwal Posted November 9, 2012 Author Share Posted November 9, 2012 The conclusion is that the problem is not mine its from server. So we need to confirm it from server administrator to check the mail server. And provide some test mail user id and password. Am i right? Link to comment Share on other sites More sharing options...
justsomeguy Posted November 9, 2012 Share Posted November 9, 2012 It might be your problem if they purposely set it up this way and expect you to use a third party mail server, for example. You need to ask them how they set it up and how they want you to send email through PHP. Link to comment Share on other sites More sharing options...
rahultailwal Posted November 14, 2012 Author Share Posted November 14, 2012 Finally it worked. The problem was from server configuration. Server administrator did something, don't know what, but it worked. Thanks for support Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now