-
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)
-
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?
-
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
-
By hatakastation in forum Database
Replies: 2
Last Post: 07-05-2007, 09:22 PM
-
By priya in forum ASP.NET
Replies: 1
Last Post: 01-17-2002, 10:12 PM
-
Replies: 3
Last Post: 10-10-2001, 05:12 PM
-
Replies: 2
Last Post: 09-27-2001, 09:09 AM
-
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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|