Can you do it manually using telnet?
http://www.activexperts.com/activemail/telnet/
If you can get that working you can probably work it out for yourself.
Remember you’ll need a public domain name to send email to gmail.com
e.g. your server is mail.somedomain.com
telnet mail.gmail.com 25
220 some gmail.com message ready.
helo mail.somedomain.com
here gmail would do a dns lookup on mail.somedomain.com to make sure you
are who you say you are to prevent spoofed mails
Ross