I asked a similar question not long ago and received what seemed to be an excellent. I was apparently overconfident in my abilities and don't know how to apply the code:
strTo = "destination@email.here" ' You should put the email destination address herestrFrom = "your@email.here" ' You should put your own gmail email address herestrSubject = "My Subject" 'You should put the subject of email herestrBody = "The text of the e-mail" 'You should put the text of the email herestrServer = "smtp.gmail.com" ' The smtp gmail server hereintPort = 466 ' The SSL port (SSL is required for sending emails using gmail)strUsername = strFrom 'The username should be the same as your gmail email addressstrPassword = "Put the password of your gmail account here"intSentUsing = 2 ' Use SMTP over networkintAuthenticate = 1 ' Basic AuthenticationblnUseSSL = truebOk = SendEmail(strTo, strFrom, strCC, strBCC, strSubject, strBody, strServer, intPort, strUsername, strPassword, intSentUsing, intAuthenticate, blnUseSSL)if not bOk then MsgBox("Error","Error sending email")end if
http://email.about.com/od/accessinggmail/f/Gmail_SMTP_Settings.htm
So try something like this:
Open in new window
If something is wrong maybe you can debug inside the function and see what is happening.
Hope this helps. Regards.