Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
' Creates a new instance of Gmail's smtp server.
Dim smtp As New SmtpClient("smtp.gmail.com", 587) ' The smtp address and port number.
' Creates the required to and from addresses.
Dim sendTo As New MailAddress("whoitsgoingto@gmail.com", "senders name here")
Dim sentFrom As New MailAddress("whoitsbeingsentfrom@gmail.com", "recipiants name goes here")
' Creates a new e-mail message
Dim message As New MailMessage(sentFrom, sendTo)
' Adds the subject and body of the e-mail.
message.Subject = "Subject goes here."
message.Body = "The body of the e-mail goes here."
message.IsBodyHtml = True ' Allows for HTML coding in the body.
' Adds someone to the Carbon Copy address.
message.CC.Add(New MailAddress("carboncopyrecipiantsemail@gmail.com", "carbon recipiants name here"))
' Provides authentication to use Gmail's SMTP server
Dim auth As New System.Net.NetworkCredential("youruserid@gmail.com", "your gmail password here")
smtp.DeliveryMethod = SmtpDeliveryMethod.Network
smtp.UseDefaultCredentials = False
smtp.EnableSsl = True
smtp.Credentials = auth
Try
' Sends e-mail and provides confirmation.
smtp.Send(message)
confirm.Text = "Email request was sent."
Catch ex As Exception
confirm.Text = "Error: " & ex.Message
End Try
, I just meant that I don't really have a need to send anything via SMTP via a gmail account at the moment (or really anything via SMTP that is not done by SQL Server).Well, maybe it will.