1. Download msmtp file from here. and past .exe file in "C:\Windows\System32"
  2. Copy code from this link and save it as "ThawtePremiumServerCA_b64.txt" in "C:\ProgramData".
  3. Copy given code and save it as "msmtprc.txt" in "C:\ProgramData".
    1. include your gmail information in the file
    2. account gmail
      host smtp.gmail.com
      auth on
      user username@gmail.com
      password yourpassword
      tls on
      tls_starttls on
      tls_trust_file "C:\ProgramData\ThawtePremiumServerCA_b64.txt"
      port 587
      from username@gmail.com
      maildomain gmail.com
      account default : gmail
  4. open php.ini file and chenge the sendmail_path to:

    1. sendmail_path = 'msmtp -t'

Done...........