Hello all,
I'm using WAMP server 3.0.6 (64bit). I was trying to send email from my php code but it's not working. I don't get any error message but the code is not sending any email.
I have done the following steps:
1- I have downloaded Sendmail.zip extracted it and put it in the root folder of WAMP.
2- Editing sendmail/sendmail.ini file
"
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
;default_domain=localhost
error_logfile=error.log
;debug_logfile=debug.log
auth_username=myemail@gmail.com
auth_password= mypass
pop3_server=
pop3_username=
pop3_password=
force_sender= myemail@gmail.com
force_recipient=
hostname=localhost"
3- Edit php.ini in the php directory:
([mail function]
; For Win32 only.
; [php.net]
SMTP =
; [php.net]
smtp_port =
; For Win32 only.
; [php.net]
sendmail_from = myemail@gmail.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i" ).
; [php.net]
sendmail_path = "C:\wamp64\sendmail\sendmail.exe -t -i" )
4- I also found out that i have to edit php.ini in the Apache folder, but i don't have this file there. There is only a php.ini but as a (.symlink) it's like a shortcut and i can't open it or edit it.
after this i created a test code in php to send email:
$to = "otheremail@test.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: myemail@gmail.com";
if(mail($to,$subject,$txt,$headers))
print "success";
But I didn't get a result.
Can you please help me?
I'm using WAMP server 3.0.6 (64bit). I was trying to send email from my php code but it's not working. I don't get any error message but the code is not sending any email.
I have done the following steps:
1- I have downloaded Sendmail.zip extracted it and put it in the root folder of WAMP.
2- Editing sendmail/sendmail.ini file
"
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
;default_domain=localhost
error_logfile=error.log
;debug_logfile=debug.log
auth_username=myemail@gmail.com
auth_password= mypass
pop3_server=
pop3_username=
pop3_password=
force_sender= myemail@gmail.com
force_recipient=
hostname=localhost"
3- Edit php.ini in the php directory:
([mail function]
; For Win32 only.
; [php.net]
SMTP =
; [php.net]
smtp_port =
; For Win32 only.
; [php.net]
sendmail_from = myemail@gmail.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i" ).
; [php.net]
sendmail_path = "C:\wamp64\sendmail\sendmail.exe -t -i" )
4- I also found out that i have to edit php.ini in the Apache folder, but i don't have this file there. There is only a php.ini but as a (.symlink) it's like a shortcut and i can't open it or edit it.
after this i created a test code in php to send email:
$to = "otheremail@test.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: myemail@gmail.com";
if(mail($to,$subject,$txt,$headers))
print "success";
But I didn't get a result.
Can you please help me?