Click here to Skip to main content
Licence CPOL
First Posted 8 Nov 2009
Views 29,150
Downloads 2,578
Bookmarked 37 times

Email and SMS Sending Through VB.NET for Free

By balaji2525 | 17 Nov 2009
Send free SMS from your VB.NET application
5 votes, 41.7%
1
1 vote, 8.3%
2
3 votes, 25.0%
3
1 vote, 8.3%
4
2 votes, 16.7%
5
2.28/5 - 12 votes
μ 2.28, σa 2.74 [?]

Introduction

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 http://email2sms.netcore.co.in/, 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 9897345890@m3m.in. 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 http://email2sms.netcore.co.in/.
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 & "@gmail.com", TextBox2.Text)
smtpServer.Port = 587
smtpServer.Host = "smtp.gmail.com"
smtpServer.EnableSsl = True
mail.From = New MailAddress(TextBox1.Text & "@gmail.com")
If RadioButton1.Checked = True Then
mail.To.Add("91" & TextBox3.Text & "@m3m.in")
ElseIf RadioButton2.Checked = True Then
mail.To.Add(TextBox3.Text)
End If
mail.Subject = TextBox4.Text
mail.Body = TextBox5.Text()
smtpServer.Send(mail)
MsgBox("mail is sent", MsgBoxStyle.OkOnly, "Report")
End Sub

Hope this code will be helpful...

License

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

About the Author

balaji2525



India India

Member


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Questionsending email failed PinmemberMember 76990907:14 24 Sep '11  
GeneralAny idea of sending sms without using the 3rd part (m3m) registration. PinmemberDineshSIS0:15 23 Aug '10  
GeneralRe: Any idea of sending sms without using the 3rd part (m3m) registration. Pinmemberbalaji252516:56 25 Aug '10  
GeneralRe: Any idea of sending sms without using the 3rd part (m3m) registration. Pinmemberbalaji252517:03 25 Aug '10  
Questionwhat about israel ? PinmemberBEDEK334:37 6 Mar '10  
GeneralMy vote of 2 PinmemberVamsi Pulavarthi6:44 15 Dec '09  
GeneralMy vote of 1 PinmvpAshfield6:19 18 Nov '09  
Generalcalculator in vb Pinmembersura9452:53 16 Nov '09  
GeneralRe: calculator in vb Pinmemberbalaji25258:12 17 Nov '09  
GeneralMy vote of 1 PinmemberGriffinPeter9:21 13 Nov '09  
GeneralRe: My vote of 1 Pinmemberbalaji25258:03 17 Nov '09  
GeneralRe: My vote of 1 Pinmemberbalaji25258:06 17 Nov '09  
if u ve any better idea on this topic just tell me....
Generalpls help Pinmembermhn2171:25 9 Nov '09  
GeneralRe: pls help PinmemberGriffinPeter9:21 13 Nov '09  
GeneralMy vote of 1 PinmemberDennis Micheelsen21:10 8 Nov '09  
GeneralMy vote of 1 Pinmemberkalyankrishna17:30 8 Nov '09  
GeneralRe: My vote of 1 Pinmemberbalaji25258:08 17 Nov '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web04 | 2.5.120210.1 | Last Updated 17 Nov 2009
Article Copyright 2009 by balaji2525
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid