Results 1 to 2 of 2

Thread: message when sending SMS

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2007
    Posts
    19

    message when sending SMS

    the code here is to send sms .my question is when i send the sms i need message in msgbox that the message is send
    the code
    For i = 0 To lstlist.ListCount - 1
    MSComm1.Output = ("at+cmgf=1")
    SleepEx 1000, False
    MSComm1.Output = Chr(13)
    SleepEx 1000, False
    MSComm1.Output = ("at+cmgs=")
    SleepEx 1000, False
    MSComm1.Output = Chr(34)
    SleepEx 1000, False
    MSComm1.Output = lstlist.List(i)
    SleepEx 1000, False
    MSComm1.Output = Chr(34)
    SleepEx 1000, False
    MSComm1.Output = Chr(13)
    SleepEx 1000, False
    MSComm1.Output = txtmsg.Text
    SleepEx 1000, False
    MSComm1.Output = Chr(26)
    Next i


    thank's

  2. #2
    Member
    Join Date
    Sep 2007
    Location
    Lictin
    Posts
    36

    Re: message when sending SMS

    You should put a code on MSComm event. Add this to the comevent,

    Private Sub MSComm1_OnComm()
    if MSComm1.commEvent = comEvReceive Then
    'check if sent successfully
    if instr(MSComm1.input,"CMGS") then
    MsgBox("SMS sent")
    end if
    if instr(MSComm1.input,"CMS ERROR") then
    MsgBox("SMS sending failed")
    end if

    MSComm1.inbuffercount = 0 'clear the buffer for next event
    end if
    end sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width