How to send Multiline sms using gnokii with vb.net

314 views Asked by At

dear all im tried to send multiline sms using gnikii but it fails

 Dim xCmd As String
    xCmd = "cmd.exe /c echo " & txtBody.Text & " | c:\sms\gnokii.exe --sendsms 0771234567 2> test.txt"
    Shell(xCmd)

Please help me

1

There are 1 answers

0
Archlight On

You can split your text on vbCrLf and add echo in front so you end up with this cmdline instead

cmd.exe /c lineOne echo line2 | c:\sms\gnokii.exe --sendsms 0771234567 2> test.txt

code wise you can do it like this:

    Dim sString As String 
    Dim aLines As String()
    Dim xCmd As String

    sString = "lineOne" & vbCrLf & "line2"
    aLines = sString.Split(vbCrLf)
    sString = Join(aLines," echo")

    xCmd = "cmd.exe /c " & sString & " | c:\sms\gnokii.exe --sendsms 0771234567 2> test.txt"
    Shell(xCmd)