I tried using PHP's mail() function for my website's "Forgot Password" page. It didn't work.
Next i tried configuring my php.ini file and that also did not work.
Finally i tried using sendmail and that also did not work....everything in vain...Please help.
PHP mail() function problems
Moderator: General Moderators
-
Rajesh Kumar
- Forum Newbie
- Posts: 2
- Joined: Sat Feb 27, 2010 8:34 pm
Re: PHP mail() function problems
There are so many possible reasons why this is not working it would be impossible to diagnose without seing your code and/or error messages you are receiving.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
-
Rajesh Kumar
- Forum Newbie
- Posts: 2
- Joined: Sat Feb 27, 2010 8:34 pm
Re: PHP mail() function problems
part of my php.ini file below: I'm a newbie to PHP.
so explain everything in detail. NOTE: I'm using PHP under Windows(win7) using XAMPP
[mail function]
; For Win32 only.
;http://php.net/smtp
SMTP =localhost
;http://php.net/smtp-port
smtp_port =25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
; 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-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off
; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "C:\xampp\apache\logs\php_mail.log"
[mail function]
; For Win32 only.
;http://php.net/smtp
SMTP =localhost
;http://php.net/smtp-port
smtp_port =25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
; 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-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off
; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "C:\xampp\apache\logs\php_mail.log"
Re: PHP mail() function problems
Unless you have configured mercury mail server included with XAMPP, you will not be able to use 'localhost' as the SMTP server
Try: http://www.youtube.com/watch?v=_QnfF64rA78
Edit: This will not allow you to send email to online accounts, just other local accounts but you can use it for testing
Try: http://www.youtube.com/watch?v=_QnfF64rA78
Edit: This will not allow you to send email to online accounts, just other local accounts but you can use it for testing
Re: PHP mail() function problems
Yes, you will need a mail server. You can download free SMTP servers for windows.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.