Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mail Sending help
#2
I've searched on Google and found this code:
[code2=vbnet]Imports System.Net.Mail

Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
SmtpServer.Credentials = New Net.NetworkCredential("username@gmail.com", "password")
SmtpServer.Port = 587
SmtpServer.Host = "smtp.gmail.com"
mail = New MailMessage()
mail.From = New MailAddress("YOURusername@gmail.com")
mail.To.Add("TOADDRESS")
mail.Subject = "Test Mail"
mail.Body = "This is for testing SMTP mail from GMAIL"
SmtpServer.Send(mail)
MsgBox("mail send")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class[/code2]

If you read the code, it's pretty much self-explanatory. You need to replace some stuff with your e-mail, password etc.
Also known as Rocketalypse.
System.out.println("I prefer Java.");


Messages In This Thread
Mail Sending help - by manishshrestha60 - 09-16-2012, 03:28 AM
Re: Mail Sending help - by Vinwarez - 09-16-2012, 04:17 AM
Re: Mail Sending help - by manishshrestha60 - 09-16-2012, 05:38 AM
Re: Mail Sending help - by brco900033 - 09-16-2012, 08:50 AM
Re: Mail Sending help - by manishshrestha60 - 09-17-2012, 11:44 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)