Reputation: 791
I am trying to send email from php here are my configuration and code :
smtp_port = 25
SMTP = 'my ip address'
mail('[email protected]', 'subject', 'message', 'FROM : headerInfo');
I do not know what I am missing this is not sending emails.
Edit :
I am not getting error .. $result = mail(); echo $result;
is printing nothing.
No messages in spam.
Server is not local host the files are on remote server but i don't know if it is a SMTP server or not.
How can I UN-block ISP?
I checked the log :
fatal: bind 0.0.0.0 port 25: Address already in use
how can i fix it?
Upvotes: 0
Views: 718
Reputation: 2272
First check if the sendmail_path variable is set properly. You can see it from echo phpinfo()
in a page. The typical value is /usr/sbin/sendmail -t -i
If you are sending extra headers in the 4th parameter of the function, try to remove it and send. It is a very common scenario to have incorrect header in the mail function. Check if you have a spam filter installed in your server which is blocking your email.
If you have access check your mail log file to see if the email is blocked by the mail server or have not reached the server yet. If there is no entry of your email in the log, it means you have problem in your php code or php configuration. If it is in the log, you can see why it was not delivered.
The typical path to mail log file is /var/log/maillog
Check if you are running on localhost or that IP address doesn't have a mail server.
Upvotes: 0
Reputation: 8833
You are using default php.ini settings to send emails. It might be:
Upvotes: 1
Reputation: 92
If all is going well than you must check your smtp once again and check your php mail page. It must be uploaded on server not on your localhost system.
Upvotes: 0