# Database Discussions > Microsoft SQL Server 2005 >  Database mail setup using gmail smtp

## yogesphu

hello,

I am trying to setup database mail and I want to use gmail outgoing server. I used below instructioin bubt these don't seem to work.
---------------------------------------------
email id: youremailid#gmail.com ( should have gmail.com)
Display Name: SQL Server
Reply email: can leave blank
Server name: smtp.gmail.com ( this is really important)
port no: 587 ( on many website this is given as 465 which is wrong, use 587 )
Check : This server requires a secure connection
Check Basic Authentication
username: youremailid@gmail.com ( should have gmail.com)
password: ( top secret , dont display ) …  :Wink: 
confirm password: confirm your password

click next and also you need to make it default public profile.

After you do this, you also have to change SQL Server Agent properties, in Properties click alerts system and then select database mail.
MOST IMRORTANT when you make changes, to SQL SERVER AGENT properties, restart only SQL SERVER AGENT.

right click SQL Server Agent and click restart, and then test your database mail.

to test, right click database mail and click send test mail… VERY IMPORTANT ( Select right profile/account from drop down list), put any email id and click send test email. click ok.
-------------------------------------------------------

Anyone has other idea or suggestion??

----------


## skhanal

Are you trying to configure it in a corporate environment?. Have you checked if your firewall policy allows to use google smtp on port 587?

----------


## yogesphu

We got it figured out yesteday. and yes connectivity to their smtp was the problem. We were not even getting ping response from smtp.gmail.com. That is sorted out now and it is working fine. Thanks for your response though. :Smilie:

----------


## rwillemain

So I can understand, the solution that was found did include opening F/W port for smtp to gmail ?  If some other action was needed, be interesting to know.
Thanks. Rick

----------

