actioncros.blogg.se

Vb.net code to send sms from pc to mobile
Vb.net code to send sms from pc to mobile











vb.net code to send sms from pc to mobile

Try Dim message As New MailMessage(mFrom, mTo, mSubject, mMsg)ĭim mySmtpClient As New SmtpClient(mMailServer) ' Within a try catch, format and send the message to ' the recipient. ' Collect user input from the form and stow content into ' the objects member variables

vb.net code to send sms from pc to mobile

Object, _īyVal e As System.EventArgs) Handles btnSend.Click ' set up the carriers list - this is a fair list, ' you may wish to research the topic and add others, ' it took a while to generate this list.Ĭ( " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " " Sub Private Sub btnSend_Click( ByVal sender As System. Object, _īyVal e As System.EventArgs) Handles MyBase.Load Private Sub frmMain_Load( ByVal sender As System. The following imports were added to the top of the class: The following figure (Figure 1) shows a properly configured collection of input fields in use:įigure 1: The Demonstration Application in UseĪ quick review of the code will reveal that there is little going on there. To maintain the simplicity of the project, little in the way of error handling has been included. The application is simple, but could easily be improved by validating each of the required fields through the use of regular expressions or by at least validating that the text associated with each of the text boxes is not an empty string.

  • Message body: Captures the sender’s message content.
  • Message subject line: Captures the message’s title or subject.
  • Sender’s email server: Captures the name of the sender’s email server.
  • Sender’s email address: Captures the sender’s email address.
  • Recipient’s carrier: Captures the recipient’s carrier.
  • Recipient’s phone number: Captures the recipient’s cellular telephone number (10 digit).
  • Vb.net code to send sms from pc to mobile windows#

    The main form is a Windows application form, and it contains a few controls necessary to capture the fields needed to properly form the message. Within the project, you will find one main class: frmMain.vb. In order to begin, unzip the downloaded files and open the project provided. The source code provided includes a relatively good list of carriers to simplify the task of connecting with a cell phone, and the task itself is really no more difficult than sending an email message through a desktop or web based application. This article describes a simple way to send text messages to a cellular phone from within a VB.NET desktop application.













    Vb.net code to send sms from pc to mobile