how to set smtp for drupal
Try the SMTP module to send mails via SMTP:


  This module allows Drupal to bypass the PHP mail() function and send email directly to an SMTP server. The module supports SMTP authentication and can even connect to servers using SSL if supported by PHP.