C# .NET - sending text meaage

Asked By Ajay Gupta
23-Dec-08 08:59 AM
 cboCarrier.Items.Add("@itelemigcelular.com.br")
        cboCarrier.Items.Add("@message.alltel.com")
        cboCarrier.Items.Add("@message.pioneerenidcellular.com")
        cboCarrier.Items.Add("@messaging.cellone-sf.com")
        cboCarrier.Items.Add("@messaging.centurytel.net")
        cboCarrier.Items.Add("@messaging.sprintpcs.com")
        cboCarrier.Items.Add("@mobile.att.net")
        cboCarrier.Items.Add("@mobile.cell1se.com")
        cboCarrier.Items.Add("@mobile.celloneusa.com")
        cboCarrier.Items.Add("@mobile.dobson.net")
        cboCarrier.Items.Add("@mobile.mycingular.com")
        cboCarrier.Items.Add("@mobile.mycingular.net")
        cboCarrier.Items.Add("@mobile.surewest.com")
        cboCarrier.Items.Add("@msg.acsalaska.com")
        cboCarrier.Items.Add("@msg.clearnet.com")
        cboCarrier.Items.Add("@msg.mactel.com")
        cboCarrier.Items.Add("@msg.myvzw.com")
        cboCarrier.Items.Add("@msg.telus.com")
        cboCarrier.Items.Add("@mycellular.com")
        cboCarrier.Items.Add("@mycingular.com")
        cboCarrier.Items.Add("@mycingular.net")
        cboCarrier.Items.Add("@mycingular.textmsg.com")
        cboCarrier.Items.Add("@o2.net.br")
        cboCarrier.Items.Add("@ondefor.com")
        cboCarrier.Items.Add("@pcs.rogers.com")
        cboCarrier.Items.Add("@personal-net.com.ar")
        cboCarrier.Items.Add("@personal.net.py")
        cboCarrier.Items.Add("@portafree.com")
        cboCarrier.Items.Add("@qwest.com")
        cboCarrier.Items.Add("@qwestmp.com")
        cboCarrier.Items.Add("@sbcemail.com")
        cboCarrier.Items.Add("@sms.bluecell.com")
        cboCarrier.Items.Add("@sms.cwjamaica.com")
        cboCarrier.Items.Add("@sms.edgewireless.com")
        cboCarrier.Items.Add("@sms.hickorytech.com")
        cboCarrier.Items.Add("@sms.net.nz")
        cboCarrier.Items.Add("@sms.pscel.com")
        cboCarrier.Items.Add("@smsc.vzpacifica.net")
        cboCarrier.Items.Add("@speedmemo.com")
        cboCarrier.Items.Add("@suncom1.com")
        cboCarrier.Items.Add("@sungram.com")
        cboCarrier.Items.Add("@telesurf.com.py")
        cboCarrier.Items.Add("@teletexto.rcp.net.pe")
        cboCarrier.Items.Add("@text.houstoncellular.net")
        cboCarrier.Items.Add("@text.telus.com")
        cboCarrier.Items.Add("@timnet.com")
        cboCarrier.Items.Add("@timnet.com.br")
        cboCarrier.Items.Add("@tms.suncom.com")
        cboCarrier.Items.Add("@tmomail.net")
        cboCarrier.Items.Add("@tsttmobile.co.tt")
        cboCarrier.Items.Add("@txt.bellmobility.ca")
        cboCarrier.Items.Add("@typetalk.ruralcellular.com")
        cboCarrier.Items.Add("@unistar.unifon.com.ar")
        cboCarrier.Items.Add("@uscc.textmsg.com")
        cboCarrier.Items.Add("@voicestream.net")
        cboCarrier.Items.Add("@vtext.com")
        cboCarrier.Items.Add("@wireless.bellsouth.com")
        cboCarrier.Items.Add("@sms.ipipi.com")


Do i need to register on any of these sites, for sending message??? M confused plz tell me how to make application for sending  text message from VB application to cell phone..

A free .NET based SMS library is available  A free .NET based SMS library is available

23-Dec-08 08:21 PM

at: http://www.dotnetspider.com/resources/2548-Sending-SMS-from-C-application.aspx

you can refer the dll present in the above url and you can easily send the sms to the mobile from c#. :)

re  re

23-Dec-08 10:45 PM

u simply use this code for sending sms

#Region "Methods"

Private Sub frmMain_Load(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles MyBase.Load

    ' 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...
    cboCarrier.Items.Add("@itelemigcelular.com.br")
    cboCarrier.Items.Add("@message.alltel.com")
    cboCarrier.Items.Add("@message.pioneerenidcellular.com")
    cboCarrier.Items.Add("@messaging.cellone-sf.com")
    cboCarrier.Items.Add("@messaging.centurytel.net")
    cboCarrier.Items.Add("@messaging.sprintpcs.com")
    cboCarrier.Items.Add("@mobile.att.net")
    cboCarrier.Items.Add("@mobile.cell1se.com")
    cboCarrier.Items.Add("@mobile.celloneusa.com")
    cboCarrier.Items.Add("@mobile.dobson.net")
    cboCarrier.Items.Add("@mobile.mycingular.com")
    cboCarrier.Items.Add("@mobile.mycingular.net")
    cboCarrier.Items.Add("@mobile.surewest.com")
    cboCarrier.Items.Add("@msg.acsalaska.com")
    cboCarrier.Items.Add("@msg.clearnet.com")
    cboCarrier.Items.Add("@msg.mactel.com")
    cboCarrier.Items.Add("@msg.myvzw.com")
    cboCarrier.Items.Add("@msg.telus.com")
    cboCarrier.Items.Add("@mycellular.com")
    cboCarrier.Items.Add("@mycingular.com")
    cboCarrier.Items.Add("@mycingular.net")
    cboCarrier.Items.Add("@mycingular.textmsg.com")
    cboCarrier.Items.Add("@o2.net.br")
    cboCarrier.Items.Add("@ondefor.com")
    cboCarrier.Items.Add("@pcs.rogers.com")
    cboCarrier.Items.Add("@personal-net.com.ar")
    cboCarrier.Items.Add("@personal.net.py")
    cboCarrier.Items.Add("@portafree.com")
    cboCarrier.Items.Add("@qwest.com")
    cboCarrier.Items.Add("@qwestmp.com")
    cboCarrier.Items.Add("@sbcemail.com")
    cboCarrier.Items.Add("@sms.bluecell.com")
    cboCarrier.Items.Add("@sms.cwjamaica.com")
    cboCarrier.Items.Add("@sms.edgewireless.com")
    cboCarrier.Items.Add("@sms.hickorytech.com")
    cboCarrier.Items.Add("@sms.net.nz")
    cboCarrier.Items.Add("@sms.pscel.com")
    cboCarrier.Items.Add("@smsc.vzpacifica.net")
    cboCarrier.Items.Add("@speedmemo.com")
    cboCarrier.Items.Add("@suncom1.com")
    cboCarrier.Items.Add("@sungram.com")
    cboCarrier.Items.Add("@telesurf.com.py")
    cboCarrier.Items.Add("@teletexto.rcp.net.pe")
    cboCarrier.Items.Add("@text.houstoncellular.net")
    cboCarrier.Items.Add("@text.telus.com")
    cboCarrier.Items.Add("@timnet.com")
    cboCarrier.Items.Add("@timnet.com.br")
    cboCarrier.Items.Add("@tms.suncom.com")
    cboCarrier.Items.Add("@tmomail.net")
    cboCarrier.Items.Add("@tsttmobile.co.tt")
    cboCarrier.Items.Add("@txt.bellmobility.ca")
    cboCarrier.Items.Add("@typetalk.ruralcellular.com")
    cboCarrier.Items.Add("@unistar.unifon.com.ar")
    cboCarrier.Items.Add("@uscc.textmsg.com")
    cboCarrier.Items.Add("@voicestream.net")
    cboCarrier.Items.Add("@vtext.com")
    cboCarrier.Items.Add("@wireless.bellsouth.com")

End Sub

Private Sub btnSend_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles btnSend.Click

' Collect user input from the form and stow content into
' the objects member variables

    mTo = Trim(txtPhoneNumber.Text) & _
        Trim(cboCarrier.SelectedItem.ToString())
    mFrom = Trim(txtSender.Text)
    mSubject = Trim(txtSubject.Text)
    mMailServer = Trim(txtMailServer.Text)
    mMsg = Trim(txtMessage.Text)

' Within a try catch, format and send the message to
' the recipient. Catch and handle any errors.
    Try

        Dim message As New MailMessage(mFrom, mTo, mSubject, mMsg)
        Dim mySmtpClient As New SmtpClient(mMailServer)
        mySmtpClient.UseDefaultCredentials = True
        mySmtpClient.Send(message)

        MessageBox.Show("The mail message has been sent to " & _
                        message.To.ToString(), "Mail", _
                        MessageBoxButtons.OK, _
                        MessageBoxIcon.Information)

    Catch ex As FormatException

        MessageBox.Show(ex.StackTrace, ex.Message, _
                        MessageBoxButtons.OK, _
                        MessageBoxIcon.Error)

    Catch ex As SmtpException

        MessageBox.Show(ex.StackTrace, ex.Message, _
                        MessageBoxButtons.OK, _
                        MessageBoxIcon.Error)

    Catch ex As Exception

        MessageBox.Show(ex.StackTrace, ex.Message, _
                        MessageBoxButtons.OK, _
                        MessageBoxIcon.Error)
    End Try
End Sub

Private Sub btnExit_Click(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles btnExit.Click

' Upon user’s request, close the application
    Application.Exit()

End Sub
#End Region
http://www.codeproject.com/KB/IP/SendTxtMsg.aspx

Re :: Sending Text Message  Re :: Sending Text Message

23-Dec-08 11:44 PM
You can send SMS text messages using the following code snippet. The code uses a web service that can send an SMS text message to 90% of all mobile phones.

If you go to the URL http://www.salcentral.com/help/msgservice.com then you can download a .zip file that contains code for the whole ASP.NET project.

This .zip file is very interesting. It demonstrates how pay to use web services can be used within anyones ASP.NET project.

The code snippet to access the web service is as follows

'Before using the below code you must link the web service
'http://sal006.salnetwork.com:83/lucin/SMSMessaging/Process.xml
'Information available on www.salcentral.com

Private Sub SendMessage(ByVal p_sPhoneNumber As String, ByVal p_sMessage 
As String, ByVal p_sUsername As String, ByVal p_sPasskey As String)

    Dim smsService As New SMSService.SMSMessagingprocessService()
    Dim sCountryCodes As String

    Try

        If smsService.ValidPhoneNumber(p_sPhoneNumber) Then
            Dim result As Boolean = smsService.SendMessage(p_sPhoneNumber, 
p_sMessage, p_sUsername, p_sPasskey)
            If result = True Then
                MsgBox("The message was sent", 
MsgBoxStyle.Information, "SMS Messaging")

            Else
                MsgBox("The message could not be sent", 
MsgBoxStyle.Information, "SMS Messaging")

            End If
        End If
    Catch ex As SoapException
        MsgBox("An exception occured.  " & ex.Detail.InnerText, 
MsgBoxStyle.Critical, "SMS Messaging")
    End Try

End Sub
Hope this helps.
Re :: Sending Text Message  Re :: Sending Text Message
23-Dec-08 11:50 PM

The following article gives you more information about this:

http://www.eggheadcafe.com/community/aspnet/7/10054957/how-can-i-send-a-text-mes.aspx (Helpful)

http://www.ozekisms.com/high-performance-sms-gateway/c-sharp-sms-gateway/index_p_php_q_ow_page_number_e_309opt.html

http://www.codeproject.com/KB/database/SMS_message_from_SQL.aspx (Helpful)

http://www.codeproject.com/KB/cpp/SendSmsThroughWS.aspx

http://www.codeproject.com/KB/aspnet/SendingSMS.aspx

Hope it helps.

try this code  try this code
24-Dec-08 03:02 AM

using System.Web.Mail;
.
.
.
string toPhoneNumber = "DestinationPhoneNumber";
string login = "YoureIPIPIUsername";
string password = "YourPassword";
string compression = "Compression Option goes here - http://www.ipipi.com/help/compression.htm";
string body = "Your Message";


System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
mail.To = toPhoneNumber + "@sms.ipipi.com";
mail.From = login + "@ipipi.com";
mail.Subject = compression;
mail.Body = body;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", login);
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password);


System.Web.Mail.SmtpMail.SmtpServer = "ipipi.com";
System.Web.Mail.SmtpMail.Send( mail );

 

Also see this link:

http://www.c-sharpcorner.com/UploadFile/scottlysle/TextMsgToCellPhone12112006002339AM/TextMsgToCellPhone.aspx

It is as simple as sending an email to whatever the email address is for that carrier, list here

http://www.livejournal.com/tools/textmessage.bml?mode=details

try this code  try this code
24-Dec-08 03:08 AM

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.  To maintain the simplicity of the project, little in the way of error handling has been included.

The following figure (Figure 1) shows a properly configured collection of input fields in use:

Figure 1: The Demonstration Application in Use

A quick review of the code will reveal that there is little going on there.  The following imports were added to the top of the class:

Imports System

Imports System.Net.Mail

The System.Net.Mail import brings in the support necessary to transmit the messages generated using the application.  Following the imports and the class declaration, there is a declarations region identified and within that region is a collection of private member variables; these private member variables are created in order to supply each of the required elements of the message.

#Region "Declarations"

 

' message elements

Private mMailServer As String

Private mTo As String

Private mFrom As String

Private mMsg As String

Private mSubject As String

 

#End Region

At this point, the only thing left to do in code is to  write the following  three methods:

#Region "Methods" 

 

    Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles MyBase.Load

 

        ' 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...

        cboCarrier.Items.Add("@itelemigcelular.com.br")

        cboCarrier.Items.Add("@message.alltel.com")

        cboCarrier.Items.Add("@message.pioneerenidcellular.com")

        cboCarrier.Items.Add("@messaging.cellone-sf.com")

        cboCarrier.Items.Add("@messaging.centurytel.net")

        cboCarrier.Items.Add("@messaging.sprintpcs.com")

        cboCarrier.Items.Add("@mobile.att.net")

        cboCarrier.Items.Add("@mobile.cell1se.com")

        cboCarrier.Items.Add("@mobile.celloneusa.com")

        cboCarrier.Items.Add("@mobile.dobson.net")

        cboCarrier.Items.Add("@mobile.mycingular.com")

        cboCarrier.Items.Add("@mobile.mycingular.net")

        cboCarrier.Items.Add("@mobile.surewest.com")

        cboCarrier.Items.Add("@msg.acsalaska.com")

        cboCarrier.Items.Add("@msg.clearnet.com")

        cboCarrier.Items.Add("@msg.mactel.com")

        cboCarrier.Items.Add("@msg.myvzw.com")

        cboCarrier.Items.Add("@msg.telus.com")

        cboCarrier.Items.Add("@mycellular.com")

        cboCarrier.Items.Add("@mycingular.com")

        cboCarrier.Items.Add("@mycingular.net")

        cboCarrier.Items.Add("@mycingular.textmsg.com")

        cboCarrier.Items.Add("@o2.net.br")

        cboCarrier.Items.Add("@ondefor.com")

        cboCarrier.Items.Add("@pcs.rogers.com")

        cboCarrier.Items.Add("@personal-net.com.ar")

        cboCarrier.Items.Add("@personal.net.py")

        cboCarrier.Items.Add("@portafree.com")

        cboCarrier.Items.Add("@qwest.com")

        cboCarrier.Items.Add("@qwestmp.com")

        cboCarrier.Items.Add("@sbcemail.com")

        cboCarrier.Items.Add("@sms.bluecell.com")

        cboCarrier.Items.Add("@sms.cwjamaica.com")

        cboCarrier.Items.Add("@sms.edgewireless.com")

        cboCarrier.Items.Add("@sms.hickorytech.com")

        cboCarrier.Items.Add("@sms.net.nz")

        cboCarrier.Items.Add("@sms.pscel.com")

        cboCarrier.Items.Add("@smsc.vzpacifica.net")

        cboCarrier.Items.Add("@speedmemo.com")

        cboCarrier.Items.Add("@suncom1.com")

        cboCarrier.Items.Add("@sungram.com")

        cboCarrier.Items.Add("@telesurf.com.py")

        cboCarrier.Items.Add("@teletexto.rcp.net.pe")

        cboCarrier.Items.Add("@text.houstoncellular.net")

        cboCarrier.Items.Add("@text.telus.com")

        cboCarrier.Items.Add("@timnet.com")

        cboCarrier.Items.Add("@timnet.com.br")

        cboCarrier.Items.Add("@tms.suncom.com")

        cboCarrier.Items.Add("@tmomail.net")

        cboCarrier.Items.Add("@tsttmobile.co.tt")

        cboCarrier.Items.Add("@txt.bellmobility.ca")

        cboCarrier.Items.Add("@typetalk.ruralcellular.com")

        cboCarrier.Items.Add("@unistar.unifon.com.ar")

        cboCarrier.Items.Add("@uscc.textmsg.com")

        cboCarrier.Items.Add("@voicestream.net")

        cboCarrier.Items.Add("@vtext.com")

        cboCarrier.Items.Add("@wireless.bellsouth.com")

 

    End Sub 

 

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click

 

' Collect user input from the form and stow content into

' the objects member variables

 

        mTo = Trim(txtPhoneNumber.Text) &

  Trim(cboCarrier.SelectedItem.ToString())

        mFrom = Trim(txtSender.Text)

        mSubject = Trim(txtSubject.Text)

        mMailServer = Trim(txtMailServer.Text)

        mMsg = Trim(txtMessage.Text)

 

' Within a try catch, format and send the message to

' the recipient.  Catch and handle any errors.

        Try

 

            Dim message As New MailMessage(mFrom, mTo, mSubject, mMsg)

            Dim mySmtpClient As New SmtpClient(mMailServer)

            mySmtpClient.UseDefaultCredentials = True

            mySmtpClient.Send(message)

 

            MessageBox.Show("The mail message has been sent to " &

message.To.ToString(), "Mail", MessageBoxButtons.OK,

MessageBoxIcon.Information)

 

        Catch ex As FormatException

 

            MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK,

MessageBoxIcon.Error)

 

        Catch ex As SmtpException

 

            MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK,

MessageBoxIcon.Error)

 

        Catch ex As Exception

 

            MessageBox.Show(ex.StackTrace, ex.Message, MessageBoxButtons.OK,

MessageBoxIcon.Error)

 

        End Try

 

    End Sub 

 

    Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As

    System.EventArgs) Handles btnExit.Click

           

' Upon user's request, close the application

        Application.Exit()

 

    End Sub 

#End Region
Create New Account
help
to " & _ message.To.ToString(), "Mail", _ MessageBoxButtons.OK, _ MessageBoxIcon.Information) Catch ex As FormatException MessageBox.Show(ex.StackTrace, ex.Message, _ MessageBoxButtons.OK, _ MessageBoxIcon.Error) Catch ex As SmtpException MessageBox.Show(ex.StackTrace, ex.Message, _ MessageBoxButtons.OK, _ MessageBoxIcon.Error) Catch ex As Exception MessageBox.Show(ex.StackTrace, ex.Message, _ MessageBoxButtons.OK, _ MessageBoxIcon Error) End Try End Sub Private Sub btnExit_Click(ByVal sender As System.Object, _ ByVal e strProxyPort, strProxyUserID, strProxyPwd) If Left$(strResponse, 3) <> "OK:" Then strMsg = "SMS Proxy Setting failed with error:" & .smsERROR & _ " - " & .smsERROR_DESC msgbox strMsg exit sub end if 'Get a Session ID strSMS_SessionID = .Authenticate Visible = true ; lblMessage.Text = " Message Send Succesfully" ; } catch (Exception ex) { lblMessage.Visible = true ; lblMessage.Text = " Error in Sending message" +ex.ToString(); } } private void rdoType_SelectedIndexChanged( object sender, System.EventArgs e) { if (rdoType could not be sent", MsgBoxStyle.Information, "SMS Messaging") End If End If Catch ex As SoapException MsgBox("An exception occured. " & ex.Detail.InnerText, MsgBoxStyle.Critical, "SMS Messaging") End Try End Sub
form as sum(service1 | service2 | service3) Now when I submit the form I get the error as follows : System.Web.Services.Protocols.SoapException: Server was unable to process request. - --> System.FormatException: Failed to convert parameter value from a String to a Boolean. - --> System.FormatException: String was not recognized as a valid Boolean. at System.Boolean.Parse(String value) at
As System.String Select Case objError.GetType.Name Case "HttpException" result = "http exception: " + vbCrLf + "HTTP Error: " + objError.GetHttpCode.ToString + vbCrLf + objError.GetHtmlErrorMessage + vbCrLf + vbCrLf + objError.ErrorCode.ToString + " " + objError.Message + vbCrLf + objError.Source + vbCrLf + objError.StackTrace Case "SoapException" result = "soap exception: " + vbCrLf + objError.Message + vbCrLf + objError.StackTrace + vbCrLf Case "WebException" result = "web exception StackTrace Case "SqlException" result = "SQL exception: " + objError.Number.ToString() + " " + objError.Message + vbCrLf + objError.Server Case "FormatException" result = "Numeric Format exception: " + objError.Source + vbCrLf + objError.Message + vbCrLf + objError.StackTrace Case "Exception" result = "exception: " + vbCrLf + objError.Message + vbCrLf + objError.Source + vbCrLf + objError.StackTrace Case "String" result = "Error: " + objError Case "OverflowException" result = "OverflowException: " + objError.Source + vbCrLf + objError.Message + vbCrLf + objError.StackTrace Case "IndexOutOfRangeException Bad XPath: " + objError.Source + vbCrLf + objError.Message + vbCrLf + objError.StackTrace Case Else result = "An unanticipated error has occured for " + objError.GetType.Name End Select Return result End Function End Class Can
working on remote site I have the config below in my web.config <customErrors defaultRedirect = "error / error.aspx" mode = "On"> <error statusCode = "500" redirect = "error / error.aspx" / > <error statusCode = "404" redirect = "error / error.aspx" / > < / customErrors> I have changed the mode to RemoteOnly with no success Initially i didn