send email from useing gmail

Posted on 2007-10-21
Last Modified: 2013-11-07
Im trying to send a email using my gmail any idea why this is not working?
this is the code

    Sub SendEmail()

        Dim insMail As New MailMessage()

        insMail.Sender = New MailAddress("")
        insMail.From = New MailAddress("")
        insMail.To.Add(New MailAddress(""))
        insMail.Subject = "Testing message"
        insMail.Body = "i hope it delivered"

        Dim Smtp As New SmtpClient

        Smtp.Host = ""
        Smtp.Port = 587
        Smtp.EnableSsl = True
        Smtp.Credentials = New Net.NetworkCredential("", "mypassword", "")


    End Sub

and this is the error

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required d24sm7131381and

any help?
Question by:mbacs
    LVL 21

    Assisted Solution

    LVL 10

    Accepted Solution

    You have to change:

    Smtp.Credentials = New Net.NetworkCredential("", "mypassword", "")


    Smtp.Credentials = New Net.NetworkCredential("", "mypassword")

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now