Click here to Skip to main content
13,298,842 members (38,718 online)
Click here to Skip to main content
Add your own
alternative version


57 bookmarked
Posted 8 Nov 2009

Email and SMS Sending Through VB.NET for Free

, 17 Nov 2009
Rate this:
Please Sign up or sign in to vote.
Send free SMS from your VB.NET application


This VB.NET code sends Email and SMS for free with the help of your Gmail ID. One main advantage of this is that you can send SMS for free because most webservices are not free to use with your application.

Using the Code

I used Gmail as my SMTP server and Mytoday to support free SMS Service here in this code. Since this code uses Gmail SMTP server, you need a Gmail account to send Email. Actually SMS from the application is sent from the Email. You can send SMS only to particular numbers in India. When you register your phone number in the website, an Email ID will be given for the phone number which you register, so that when you mail to that id the message will be received as SMS in the particular number. Suppose the phone number is 9897345890 the mail id given from that website will be like this It works only for Indian numbers.

To run this application successfully, two things should be done:

  1. You must have Gmail ID.
  2. Register the phone number which you are going to use in a website
Private Sub Button1_Click(ByVal sender As System.Object, _
	ByVal e As System.EventArgs) Handles Button1.Click

Dim smtpServer As New SmtpClient()
Dim mail As New MailMessage
smtpServer.Credentials = New Net.NetworkCredential_
	(TextBox1.Text & "", TextBox2.Text)
smtpServer.Port = 587
smtpServer.Host = ""
smtpServer.EnableSsl = True
mail.From = New MailAddress(TextBox1.Text & "")
If RadioButton1.Checked = True Then
mail.To.Add("91" & TextBox3.Text & "")
ElseIf RadioButton2.Checked = True Then
End If
mail.Subject = TextBox4.Text
mail.Body = TextBox5.Text()
MsgBox("mail is sent", MsgBoxStyle.OkOnly, "Report")
End Sub

Hope this code will be helpful...


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

India India
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionSending SMS using Pin
Rakesh A Rao1-Oct-12 22:22
memberRakesh A Rao1-Oct-12 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 17 Nov 2009
Article Copyright 2009 by balaji2525
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid