Jump to content

Mail function not working


rahultailwal

Recommended Posts

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

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...