I am not able to send email

In the openfire server console, i clicked the server tab >>Email Settings then i get the form to fill the SMTP settings, currently i filled as follows.
Mail Host: smtp.gmail.com
Server Port (Optional): 465
Mail Debugging: off.
Server Username (Optional):rajeshacharaya65@gmail.com

server password : xxxxxxx
Use SSL (Optional):checked.
then i click the save changes and i click the send test mail, but I am getting the error. "Sending the message failed. Please verify that your host and port settings are correct. (Message: Could not connect to SMTP host: smtp.gmail.com, port: 465)"
please someone tell me what is going on here.

can we use openfire as email server mee?

Are there messages in the error log file? It seems that your server can not reach the gmail servers.