sankramellow

how can i make my program so i type a email address and a message and it sends a email to that email address


Re: Visual Basic Express Edition how to send emails?

ReneeC

Sankramellow,

That's been asked and answered about forty times in this forum and volumes have been written on it. I'd recommend that you use the search command and search for emal in this forum.

Infact there's a topic on this page now:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2097510&SiteID=1






Re: Visual Basic Express Edition how to send emails?

Omar Abid

Hi,

You'll need only an SMTP server

Code Snippet

Imports System.Web.mail

' the code to send
Try
Dim insMail As New MailMessage()
With insMail
.From = "omar.abid2006@gmail.com"
.To = "omar.abid2006@gmail.com"
.Subject = "test"
.Body = "test sending mails"
End With
SmtpMail.SmtpServer = "your smtp server"
SmtpMail.Send(insMail)
Console.WriteLine("Successfully sent email message" + vbCrLf)
Catch err As Exception
Console.WriteLine("EXCEPTION " + err.Message + vbCrLf)
End Try

hope this helps