Sunday, 18 September 2016
GMAIL IN VB
-----------------------------------------------------------------------------------------------------------------
SEND GMAIL IN VB 2010 CODE:
1) DRAG & DROP ONE BUTTON & THREE TEXT BOXES
2) PASTE BELOW CODE
USE REAL GMAIL AND PASSWORD
3) YOUR CODE GMAIL ADDRESS & GMAIL PASSWORD SHOULD BE EQUAL TO
YOUR DAILY ROUTINE REAL GMAIL ADDRESS & GMAIL PASSWORD WHICH
YOU USE TO OPEN GOOGLE ACCOUNT BECAUSE WITHOUT THIS IT WILL NOT
WORK
------------------------------------------------------------------------------------------------------------------
Imports System.Web
Imports System.IO
Imports System.Net.Mail
Public Class Form1
Dim email As New MailMessage
Dim smtp As New SmtpClient
Dim mail As System.Net.Mail.MailAddress
Dim Server As String = "smtp.live.com"
Private Sub Button1_Clivk(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles Button1.Click
Try
Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New
Net.NetworkCredential("ayeshahttp@gmail.com","PassWord")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.gmail.com"
e_mail = New MailMessage()
e_mail.From = New MailAddress(TextBox1.Text)
e_mail.To.Add(TextBox2.Text)
e_mail.Subject = "Email
Sending"
e_mail.IsBodyHtml = False
e_mail.Body = TextBox3.Text
Smtp_Server.Send(e_mail)
MsgBox("Mail
Sent")
Catch error_t As Exception
MsgBox(error_t.ToString)
End Try
End Sub
End Class
READ MORE:
------------------------------------------------------------------------------------------------------------------
GMAIL IN VB - YouTube
https://www.youtube.com/watch?v=128dOXtak6k
5 hours ago - Uploaded by SAVE MONEY
http://fbgadgets.blogspot.co.uk/2016/09/gmail-... ... VB.NET How to Send Mail SMTPclient Gmail + Source ...POP AND IMAP SETTING FOR OUTLOOK - YouTube
https://www.youtube.com/watch?v=dwxztj02uVM
9 mins ago - Uploaded by SAVE MONEY
POP AND IMAP SETTING FOR OUTLOOK ... Microsoft Outlook 2016 Tutorial: Adding POP IMAP Account in ...sendmail - Sending E-mail to Gmail account using VB.net 2010 ...
14 Aug 2015 - Can't see what's behind your error box, but you're probably not setting the smtp. Credentials correctly. Here's an example: ...
-----------------------------------------------------------------------------------------------------------------
SOLVE SMTP ERROR PROBLEM:
------------------------------------------------------------------------------------------------------------------
BEFORE SEND
MESSAGE
1) FIRST
SOVLE SMTP PROBLEM
Smtp
authentication exception IN VB
2) IMAP ENABLED
3) CORRECT GMAIL ADDRESS IN CODE
4) CORRECT THIS GMAIL PASSWORD IN CODE
USEFUL IMAGES:
https://www.google.com/settings/security/lesssecureapps
https://mail.google.com/mail/u/0/#settings/fwdandpop
------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------
OR USE UPPER CODE WITH TWO VARIABLES
-----------------------------------------------------------------------------------------------------------------
Imports System.Web
Imports System.IO
Imports System.Net.Mail
Public Class Form1
Private Sub Button1_Clivk(ByVal sender As
System.Object, ByVal
e As System.EventArgs)
Handles Button1.Click
Try
Dim Smtp_Server As New SmtpClient
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New
Net.NetworkCredential("ayeshahttp@gmail.com", "PassWord")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.gmail.com"
Dim e_mail As New MailMessage()
e_mail = New MailMessage()
e_mail.From = New MailAddress(TextBox1.Text)
e_mail.To.Add(TextBox2.Text)
e_mail.Subject = "Email
Sending"
e_mail.IsBodyHtml = False
e_mail.Body = TextBox3.Text
Smtp_Server.Send(e_mail)
MsgBox("Mail
Sent")
Catch error_t As Exception
MsgBox(error_t.ToString)
End Try
End Sub
End Class
Subscribe to:
Post Comments (Atom)
I am following you from quit awhile and found Another Well explained article. Thank you for sharing.
ReplyDeleteUK Leading Mobile & Computer Parts Wholesaler