Discourse setup completed successfully but not working due to SSL error

Sorry I was busy with other task. Anyone know how to use/configure mailgun or sendgrid or anyother smtp provider in discourse which is hosted in digital ocean. I did filling the details of sendgrid smtp credentials (username,password, smtp server, port, email, reply email, ssl email ..) and ran rebuild but still no use.