I am trying to send mail to Gmail in VSTS 2008 RTM using the code below. I am getting an SMTPException: "SMTP connection rquires a secure connection or client was not authenticated. 5.5.1 Authentication Required."
What do I need to do to athenticate this email appropriately so that it will send through GMail?
Gmail says tha they need the following for IMAP
Incoming Mail (IMAP) Server - requires SSL:
imap.gmail.com Use SSL: Yes Port: 993
Outgoing Mail (SMTP) Server - requires TLS:
smtp.gmail.com (use authentication) Use Authentication: Yes Use STARTTLS: Yes (some clients call this SSL) Port: 465 or 587
your Gmail username (including @gmail.com)
your full Gmail email address (firstname.lastname@example.org)
your Gmail password
Using message As _
New MailMessage(fromAddress, toAddress, subject, body)
Dim mailClient As New SmtpClient("smtp.gmail.com", 587)