I try to send email from wampserver "localhost" by this php code
<?php
$to = 'test1@gmail.com';
$subject = 'Fake sendmail test';
$message = 'If we can read this, it means that our fake Sendmail setup works!';
$headers = 'From: test2@gmail.com' . "\r\n" .
'Reply-To: eng.jirjawi@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail($to, $subject, $message, $headers)) {
echo 'Email sent successfully!';
} else {
die('Failure: Email was not sent!');
}
?>
I used the file "sendmail" and put it inside the file "C:\wamp\sendmail" i changed setting sendmail.ini file to -->
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
default_domain=localhost
error_logfile=error.log
auth_username=test2@gmail.com
auth_password=xxxxxxx
pop3_server=
pop3_username=
pop3_password=
force_sender=
force_recipient=
hostname=localhost
i changed setting php.ini file in C:\wamp\bin\apache\apache2.2.22\bin and i changed setting php.ini file in C:\wamp\bin\php\php5.4.3 to
[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP =
; http://php.net/smtp-port
;smtp_port = 25
; 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"
and i changed setting appach module "SSL module" checked
and i changed setting php extension "php openssl" & "php sockets"
And it did not work with the code did not send email
Discussed a lot in the internet and tried many ways Why does not happen transmitter and what the correct way Apologized for the mistakes my English language Please help and thank you