Results 1 to 6 of 6

Thread: [RESOLVED] Issues sending Gmail/Email

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2021
    Posts
    3

    Resolved [RESOLVED] Issues sending Gmail/Email

    Hi there,

    I am writing a simple app and am getting stuck trying to send email. It has worked before easy enough but changing to gmail has caused an issue.

    Here is the (simple/rudimentary) code:
    Dim SmtpServer As New SmtpClient("smtp.gmail.com", 465)
    SmtpServer.EnableSsl = True
    SmtpServer.Credentials = New Net.NetworkCredential("email@gmail.com", "password")
    Dim mail As New MailMessage("email@gmail.com", "email@gmail.com", "Test", "Test Body")
    SmtpServer.Send(mail)

    It hangs at .send with the following error:
    An unhandled exception of type 'System.Net.Mail.SmtpException' occurred in System.dll Additional information: Failure sending mail.

    I attached a snap of the error.

    Any ideas as I know my creds are right being as I logged in and out of gmail web app a few times on a few browsers (Google, IE, Edge).

    Thank you,

    Gary
    Attached Images Attached Images  

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,764

    Re: Issues sending Gmail/Email

    Try port 587 instead of 465.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2021
    Posts
    3

    Re: Issues sending Gmail/Email

    Bingo!

    Between that and enabling "Less Secure Apps" in my account it now works.

    Will test it with another account to make sure.

    Much appreciated!!!!

    Regards,

    Gary

  4. #4
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: Issues sending Gmail/Email

    Welcome to the forum. Glad to see your problem is solved. Could you mark this thread as resolved using the thread tools?

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2021
    Posts
    3

    Re: Issues sending Gmail/Email

    Marked as resolved Peter!

    Thank you for the Welcome as it is great to be a part.

    Regards,

    Gary

  6. #6
    Banned
    Join Date
    Dec 2021
    Posts
    1

    Re: [RESOLVED] Issues sending Gmail/Email

    It didn't help me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width