Hi, I'll be teaching you EMAIL system this time.
Firstly, we'll do some importing. Implement this at the very top of your source code.
It may have seem that all is done. But no. Here's the next few steps.Code:Imports System.Net.Mail
As you can see, all is laid out for you there. So here's the questions and answers :Code:Dim Mail As New MailMessage Mail.Subject = "(YOUR SUBJECT HERE") Mail.To.Add(youremailhere) Mail.From = New MailAddress(youremailhere) Mail.Body = TextBox2.Text Dim SMTP As New SmtpClient("smtp.gmail.com") SMTP.EnableSsl = True SMTP.Credentials = New System.Net.NetworkCredential(youremailhere, yourpwhere) SMTP.Port = "587" SMTP.Send(Mail)
Q: How do you use this code?
A: If you don't know how to use, don't use. Means you're not fit enough to use it. (:
Q: Since the smtp is gmail, does that mean it's only Gmail compatible?
A: Yes, sadly yes. But if you want to use hotmail or others, just find the smtp server for hotmail or any others and replace it with the one found here. Don't forget the SMTP.Port as well.
Q: Could I attach documents using this function?
A: Yes you can. I will give you that on tutorial 2. (:
-Peace out.



LinkBack URL
About LinkBacks

Reply With Quote

Bookmarks