Page 1 of 1
Mail Function
Posted: Mon Sep 02, 2002 6:30 am
by Love_Daddy
Hi guys,
When I'm using mail in PHP it doesn't where I send it.
What can it be a problem?

Posted: Mon Sep 02, 2002 6:32 am
by Phirus
Dont understand your question please expand...
Phirus
Posted: Mon Sep 02, 2002 6:40 am
by Love_Daddy

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")
Hope I've explained much better..
Posted: Mon Sep 02, 2002 6:49 am
by twigletmac
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?
Mac
Posted: Mon Sep 02, 2002 7:14 am
by Love_Daddy
I'll remember that next time, thanks.
Okay I've edited my php.ini file and in my SMTP option this is what I've found.
[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)
I'm not sure what to do for it to work properly.
Mail function !
Posted: Mon Sep 02, 2002 7:32 am
by gite_ashish
Hi,
For details regarding the configuratin (what, why... etc) see the PHP man:
http://www.php.net/manual/en/function.mail.html
It's really simple, give it a try man !!
Regards,
Posted: Mon Sep 02, 2002 7:45 am
by gite_ashish
Hi,
Actually, the link for config details is as below:
http://www.php.net/manual/en/ref.mail.html
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.
Regards,
Posted: Mon Sep 02, 2002 8:44 am
by Love_Daddy
Will do.
Posted: Mon Sep 02, 2002 9:38 am
by Phirus
You have to us an SMTP server, unless you are running one on your local machine, which I doubt you are.
I would use whatever SMTP server you use when sending your own email through a mail client (e.g - Outlook, NN Messenger, Moz Mail etc)
Hope that helps ya somewhat,
Phirus
Posted: Tue Sep 03, 2002 5:18 am
by Love_Daddy
Oh, I'm on Postfix...
How does that work anyway?
Posted: Tue Sep 03, 2002 5:30 am
by twigletmac
Probably best to look at the configuration settings then:
http://www.postfix.org/basic.html#myorigin
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.
Mac
Posted: Tue Sep 03, 2002 5:30 am
by gite_ashish
hi,
if you r running postfix (on red hat linux 6.x/7.x), setting following in php.ini should work
sendmail_path = /usr/sbin/sendmail
while executing your php script, which contains mail() function, see the mailog also:
if running on solaris, i think the path need to be
/var/adm/maillog. generally
maillog file is readable to everyone.
regards,
Posted: Tue Sep 03, 2002 5:34 am
by twigletmac
It probably would make it a lot easier to offer help if you did actually tell us which OS and webserver you are using.
Mac
Posted: Tue Sep 03, 2002 6:14 am
by Love_Daddy
Well, I'm on Mandrake Linux 8.2 and apache/postgreSQL and PHP
and yesterday, I tried installing sendmail and it told me that I'm postfix..