Desperate help in sending an email


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Desperate help in sending an email

Hybrid View

  1. #1
    Join Date
    Apr 2009
    Posts
    13

    Desperate help in sending an email

    I have a program that I want to generate an email....someway. I have tried using gmail, but it keeps erroring. does anybody know a way for me to be able to generate an email? Any help would be great...here is my code that i have from the gmail....it didnt work.

    Code:
            'Sending the email
            Dim mail As New MailMessage()
    
            'set the addresses
            mail.From = New MailAddress("plagarism.notify.upb@gmail.com")
            mail.To.Add("plagarism.receive.upb@gmail.com")
    
            'set the content
            mail.Subject = "Plagarism Notification URGENT"
            mail.Body = Body + ControlChars.NewLine + "--------------------------------" + ControlChars.NewLine + OffensesCheck
    
            'send the message
            Dim smtp As New SmtpClient("smtp.gmail.com", 587)
            smtp.EnableSsl = True
            smtp.DeliveryMethod = SmtpDeliveryMethod.Network
            smtp.Credentials = New NetworkCredential("plagarism.notify.upb@gmail.com", "passwordhere")
            smtp.Send(mail)

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    Saying it doesn't work and keep erroring isn't really helpful.

    What are the specific error(s) and what line(s) of code cause them?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Apr 2009
    Posts
    13
    yea you are right. i apologize, in my frustration i just posted the problem like you are all mind readers and i neglected to post the error and how its being handled. Thank you for reminding me.

    here is my error.

    The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. c26sm5896142waa.50

    here is the code again

    Code:
            'create the mail message
            Dim mail As New MailMessage()
    
            'set the addresses
            mail.From = New MailAddress("plagarism.notify.upb@gmail.com")
            mail.To.Add("plagarism.receive.upb@gmail.com")
    
            'set the content
            mail.Subject = "This is an email"
            mail.Body = Body + ControlChars.NewLine + "--------------------------------" + ControlChars.NewLine + OffensesCheck
    
            'send the message
            Dim smtp As New SmtpClient("SMTP.gmail.com")
    
            'to authenticate we set the username and password properites on the SmtpClient
            smtp.Credentials = New NetworkCredential("plagarism.notify.upb@gmail.com", "...")
            smtp.Port = 587
            smtp.Send(mail)

Similar Threads

  1. Sending email in html format from database
    By hatakastation in forum Database
    Replies: 2
    Last Post: 07-05-2007, 10:22 PM
  2. sending email from exe file through ASP
    By priya in forum ASP.NET
    Replies: 1
    Last Post: 01-17-2002, 10:12 PM
  3. sending email not work?
    By giit in forum ASP.NET
    Replies: 3
    Last Post: 10-10-2001, 06:12 PM
  4. Sending an email not working?
    By geeta in forum .NET
    Replies: 2
    Last Post: 09-27-2001, 10:09 AM
  5. Sending email when a record is added
    By MikeV in forum Database
    Replies: 1
    Last Post: 12-28-2000, 05:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center