PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm using the PHP Mail Function of which I need to send an e-mail to myself.
But It doesn't return any error but never sends the e-mail to me either.
Or any other e-mail address that I specify..
I know the format is:
Mail ("To","Subject","Message")
When you ask a question on the forum you are more likely to actually get the help you need if you explain the problem clearly including any relevant code that you are using (please narrow this down to the part of the script causing problems), any error messages that you are receiving and a description of what is actually happening when you use the script and what you expect to happen.
That said:
Have you checked that the SMTP and sendmail_from values (if you are using Windows) or the sendmail_path (if you are using *nix) in your php.ini are correct?
And see the section Mail Configuration Directives.
The earlier posted link is for mail() function details and not for config details... sorry for that
[mail function]
SMTP = localhost ;for win32 only
sendmail_from = me@localhost.com ;for win32 only;
sendmail_path = ;for unix only, may supply arguments as well (default is sendmail -t)
* The first (SMTP = ) and second (sendmail_from = ) parameter are needed if you are using php on win32 platform (win nt/2000/xp)
* The third (sendmail_path = ) parameter is needed if you are using php on *nix (linux,solaris,*bsd...etc)
If you are using red hat linux 6.x/7.x with default installation:
sendmail_path = /usr/sbin/sendmail
should work fine !
Let us know what platform u r using to run php and go through the php man url given above.
Another thing you may be able to do is ask the administrator of the web server (obviously this is a moot point if that's you) what the name or IP address of your SMTP server is. Or ask your ISP what setting you should use for SMTP.