Hi All,
I am a newbie to php. I am try to send mail from my web application but I can't do that. I had google alot and found mail() internally calls sendmail and we need to edit php.ini for that.Here is my php.ini's [mail function].
[text]
[mail function]
; For Win32 only.
; http://www.php.net/manual/en/mail.confi ... p#ini.smtp
SMTP = localhost
; http://www.php.net/manual/en/mail.confi ... .smtp-port
smtp_port = 25
; For Win32 only.
; http://www.php.net/manual/en/mail.confi ... dmail-from
;sendmail_from = me@example.com
sendmail_from = root@localhost
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://www.php.net/manual/en/mail.confi ... dmail-path
sendmail_path = /usr/sbin/sendmail -t -i
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
; Add X-PHP-Originaiting-Script: that will include uid of the script followed by the filename
mail.add_x_header = On
; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log =
[/text]
Is it fine or do I need to add anything else. Please help me in this regard. Your help is appreiciated.
Thanks
Bhanu
help with PHP mail()
Moderator: General Moderators
Re: help with PHP mail()
Well for useing mail() on Localhost, i messed around a lot myself. Easiest way was to set up and email server in my computer. i used http://www.qksoft.com/qk-smtp-server because i didn't get the apaches original system to work. Best way is to test your script online server where mail() function is allwed. (almost every server has mail() function disabled) so chose wisely.
or there are other alterantives. There are some sites that let you customize your script and after copying the code to your webpage you can use the form for sending emails useing their server where mail() function is turned on.
//third part is: When it will not send the email: Check the headers your mail form sends. Maby you got something wrong there and the mails just wont be sent.
PHP reports that mail has been sent but mailserver has the red light because of SPAM scare.
or there are other alterantives. There are some sites that let you customize your script and after copying the code to your webpage you can use the form for sending emails useing their server where mail() function is turned on.
//third part is: When it will not send the email: Check the headers your mail form sends. Maby you got something wrong there and the mails just wont be sent.
PHP reports that mail has been sent but mailserver has the red light because of SPAM scare.