Results 1 to 4 of 4

Thread: Can't send email

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2012
    Posts
    221

    Can't send email

    Hello,

    Please help me with the following problem. It is a code that worked in the past and now it doesn't work and I don't know why. It sends an email:

    Code:
     Try
                Dim SmtpServer As New SmtpClient()
                Dim mail As New MailMessage()
                SmtpServer.Credentials = New Net.NetworkCredential("email@gmail.com", "password")
    
                SmtpServer.EnableSsl = True
                SmtpServer.Port = 587
                SmtpServer.Host = "smtp.gmail.com"
                mail = New MailMessage()
                mail.To.Add("myemail@gmail.com")
                mail.From = New MailAddress("email@gmail.com")
    
                mail.Subject = "Subject text"
                mail.Body = "Body text"
                SmtpServer.Send(mail)
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
    And I get this message in the attached picture.Name:  Untitled.png
Views: 162
Size:  15.4 KB

  2. #2
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,823

    Re: Can't send email

    I don't use gmail, but check the settings...Port etc...

    https://developers.google.com/gmail/imap/imap-smtp
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  3. #3
    Fanatic Member
    Join Date
    Aug 2004
    Location
    Essex, UK
    Posts
    682

    Re: Can't send email

    Is the gmail account set to "trust less secure apps"?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2012
    Posts
    221

    Re: Can't send email

    Can't do that because it is a simple email address. admin.google.com is used for G Suite account only.

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