How send e-mails using VB.net?
Hey guys. Today I will do a very simple tutorial to send e-mails, let´s go!
First open your Visual Studio and Crte a New Project using Visual Basic. Rename it if you want.
So, in your Form add three TextBox ok? One it will be to text the message (Body), other to write the subject (Subject) and finally the destiny (To). Add also a Button with the text “Send”. Double-Click in the button.
Send E-mail Form
Try
Dim Mail AsNew MailMessage
Dim SMTP AsNew SmtpClient("smtp.live.com") 'server of Outlook, Live and Hotmail accounts
SMTP.EnableSsl = True
Add a Login Form
Now I will tch you using a Login Form to send e-mails. It´s very sy. First you will add a new form. I will use a LoginForm to make it sier but you can use a normal form. Right-Click in your Project < Add < Form < LoginForm. Rename it if you want. Now Double-Click in OK button. If you use a normal Form use have to add one Textbox, a MeskedTextBox, two buttons (OK & Cancel or Close).
Private Sub OK_Click(ByValsender As System.Object, ByVal e AsSystem.EventArgs) HandlesOK.Click
Now you just have to change the StartUp Form from Form1 to LoginForm1. I hope you liked. Any questions send e-mail for hyrokumata@outlook.com
No comments:
Post a Comment