If you want to use SMTP instead sendmail to improve email delivery or prevent having your mails marked as spam in the spam box of your email account.
You will need to install the Magento SMTP extension on your Magento Store.
After when you have your Magento SMTP extension installed. Log in your Magento Admin panel and refer to the System > Configuration section. Then click on the Advanced > System section.
On the page SMTP Email SMTP Settings fill in your SMTP credentials, hostname and port. These data should be provided by your email provider. When you are ready, please click on the Save button. Done!