Q: How to send email from wamp localhost I want to send email from my localhost server. I am using here wamp server and sendmail option. but i am getting no error :-
but no mail are sending to the users email
if (!$result)
{
    die (mysql_error());
}


if ($result == 1)
{
    $rows = mysql_fetch_array($sql);
    $password = $rows['pwd'];
    $email = $rows['user_email'];
    $subject ="Password request";
    $header = "FROM: sazalach@gmail.com";
    $body = "Your password is " . $password;

    mail ($email, $subject, $header, $body);
    print("an email containning the password has been sent to you");
}else
{
    echo ("No such user exists in the system. Please try again");
}

Here is below sendmail configuration:
smtp_server=smtp.gmail.com

; smtp port (normally 25)

smtp_port=465

; SMTPS (SSL) support
;   auto = use SSL for port 465, otherwise try to use TLS
;   ssl  = alway use SSL
;   tls  = always use TLS
;   none = never try to use SSL

smtp_ssl=auto

; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify

;default_domain=mydomain.com

; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging

error_logfile=error.log

; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging

;debug_logfile=debug.log

; if your smtp server requires authentication, modify the following two lines

auth_username=sazalach@gmail.com
auth_password=

; if your smtp server uses pop3 before smtp authentication, modify the 
; following three lines.  do not enable unless it is required.

Below configuration is in php.ini file
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 465

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = you@yourdomain

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "C:\wamp\sendmail\sendmail.exe -t"

