无法使用XAMPP SendMail发送邮件

I trying to send a mail using PHP mail function but unable to do and getting below messages in debug file:

--- MESSAGE BEGIN --- 15/09/23 09:13:49 ** To: xyz@gmail.com 15/09/23 09:13:49 ** Subject: the subject 15/09/23 09:13:49 ** 15/09/23 09:13:49 ** 15/09/23 09:13:49 ** the message 15/09/23 09:13:49 ** --- MESSAGE END --- 15/09/23 09:13:49 ** Connecting to smtp.gmail.com:587 15/09/23 09:14:02 ** Disconnected. 15/09/23 09:14:02 ** Disconnected. 15/09/23 09:14:02 ** Disconnected. 15/09/23 09:14:02 ** Socket Error # 11001Host not found.

For this, I have installed ZAMPP v3.2.1 on Windows7.

And made following entries as:

php.ini-

SMTP= smtp.gmail.com
smtp_port= 587 
sendmail_from = my gmail id 
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

I downloaded a latest sendmail folder and did these settings in that. Also I tried to use 25 port and SMTP as localhost but they also did not worked.

sendmail.ini-

smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
error_logfile=error.log
debug_logfile=debug.log
auth_username=mygmailid
auth_password=mygmailpassword

Tried with ssl, auto etc but did not worked.

Also tried by setting compatibility of send Mail executable file with 'Run as admin' but in that case it needs a acceptation prompt on my machine and if I accepts that then it returns some value in my mail function and I got response as 'Mail Sent' but in actual mail also not received.

Make sure the following extensions enables php_sockets & php_smtp