I would like to send an email to my gmail account everytime my simulation ends. I have tried searching the web and found sendEmail but it is timing-out. If anyone could poin
libESMTP seems to be what you are looking for. It's very well documented and also seems to be under active development (last Release Candidate is from mid-January 2012). It also supports SSL and various authentication protocols.
There are example applications in the source package.