VB.net and GMAIL

Discussion in 'Automated Trading' started by polee2000, May 16, 2005.

  1. Is anyone using gmail SMTP to send trade confirmation ?
    if so can you paste your code ? ( of course without the login information )
    thanks
     
  2. I don't understand why you would use gmail's smtp server rather than your isps.
     
  3. mail.To = "myaccount@gmail.com"
    mail.From = "myaccount@gmail.com"
    mail.Subject = "Trade Execution Report"
    mail.Body = execLine & " " & execTime
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "myaccount@gmail.com") 'set your username here
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password") 'set your password here
    mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465") 'Put port number here
    SmtpMail.SmtpServer = "smtp.gmail.com" 'your real server goes here
    SmtpMail.Send(mail)
    MsgBox("mailsent")

    i did couple test trades. but i have no idea if indeed my program sent the mail thru gmail smtp. is it because i picked the wrong smtpauthenticate ?