Skip to main content
Email Password   helpLost your password?
Download Email.zip - 58.43 KB

Introduction

This vb.net code send Email and Sms for free with the help of your Gmail ID. One main advantage of this is 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 use 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 a particular numbers in India.  when you register your phone number in the website http://email2sms.netcore.co.in/ a 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 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 so this code will be helpful....

 

You must Sign In to use this message board.
 
 
Per page   
 FirstPrevNext
GeneralMy vote of 1 Pin
Ashfield
6:19 18 Nov '09  
Generalcalculator in vb Pin
sura945
2:53 16 Nov '09  
GeneralRe: calculator in vb Pin
balaji2525
8:12 17 Nov '09  
GeneralMy vote of 1 Pin
GriffinPeter
9:21 13 Nov '09  
GeneralRe: My vote of 1 Pin
balaji2525
8:03 17 Nov '09  
GeneralRe: My vote of 1 Pin
balaji2525
8:06 17 Nov '09  
Generalpls help Pin
mhn217
1:25 9 Nov '09  
GeneralRe: pls help Pin
GriffinPeter
9:21 13 Nov '09  
GeneralMy vote of 1 Pin
Dennis Micheelsen
21:10 8 Nov '09  
GeneralMy vote of 1 Pin
kalyankrishna1
7:30 8 Nov '09  
GeneralRe: My vote of 1 Pin
balaji2525
8:08 17 Nov '09  


Last Updated 17 Nov 2009 | Advertise | Privacy | Terms of Use | Copyright © CodeProject, 1999-2009