SMS from PC using ActiveSync - Windows Mobile Development and Hacking General

Hello all,
I need to code a simple application for send SMS from PC using PDA connected with ActiveSync.
- I don't need gui. DOS is enough
- I can code using Visual Studio 2005/2008 (.net features)
- Executable will be called by another application so I need to pass it Recipiend Number and text, like => sms.exe 1234567890 "SMS TEXT"
Could someone help me? I'm totally stuck since I've no idea how interface application with ActiveSync and then how to send SMS!!!!

seen this?
http://forum.xda-developers.com/showthread.php?t=324684

Lord Spectre said:
Hello all,
I need to code a simple application for send SMS from PC using PDA connected with ActiveSync.
- I don't need gui. DOS is enough
- I can code using Visual Studio 2005/2008 (.net features)
- Executable will be called by another application so I need to pass it Recipiend Number and text, like => sms.exe 1234567890 "SMS TEXT"
Could someone help me? I'm totally stuck since I've no idea how interface application with ActiveSync and then how to send SMS!!!!
Click to expand...
Click to collapse
Hi! I am using Mymobiler. http://www.mymobiler.com/
Its freeware and it remote control yr phone thru yr pc..

If you want to program it yourself, check out RAPI on MSDN.
Also, to send an SMS, you can either use MAPI, or just launch tmail with parameters. See here for details on the latter.

CheongKing said:
Hi! I am using Mymobiler. http://www.mymobiler.com/
Its freeware and it remote control yr phone thru yr pc..
Click to expand...
Click to collapse
I do that too. It's a great free app

Thanks all,
but let me explain better my goal.
I don't need a GUI application and I don't need PDA application, since I need to start it from PC then send SMS trough PDA connected to activesync, like:
PC => ACTIVESYNC => PDA
On PC I'll execute this dos application based, passing parameter like recipient number and message text like:
sms.exe 123456789 "TEXT"
That's it!
l3v5y thanks for your hint, but I'm still search for code example, since I'm new on this programming technique.

Lord Spectre said:
Thanks all,
but let me explain better my goal.
I don't need a GUI application and I don't need PDA application, since I need to start it from PC then send SMS trough PDA connected to activesync, like:
PC => ACTIVESYNC => PDA
On PC I'll execute this dos application based, passing parameter like recipient number and message text like:
sms.exe 123456789 "TEXT"
That's it!
l3v5y thanks for your hint, but I'm still search for code example, since I'm new on this programming technique.
Click to expand...
Click to collapse
Once I've fixed my XP installation, I'll get to it...
There's an exe somewhere called prun.exe, that would allow you to run tmail.exe via command line parameters on your desktop... So you could have a batch file with:
Code:
prun.exe \Windows\tmail.exe -transport "SMS" -to %1 -body %2
and launch it with whatever parameters you wanted.

Thanks l3v5y, prun was a great application, but unfortunately it doesn't work.
Let me explain my test, first of all there's no necessary to specify \Windows directory, just using:
prun.exe tmail.exe
and then message screen popup on my phone.
Also I tried to run other program from desktop like "Slide To Unlock" and TomTom Navigator. GREAT! They work both!
Next step was try to going directly to SMS inbox:
tmail.exe -transport "SMS"
Sh*t! It doesn't work! And for sure other parameters doesn't work too...
Like: prun.exe tmail.exe -transport "SMS" -to "1234567890" -body "TEST SMS"
I tried with HTC Trinity and HTC Diamond....
UPDATE:
I tried multiple line commands, like:
prun.exe tmail.exe <= works (show me message window)
tmail.exe -transport "SMS" <= works (show me SMS service. I used also -service with same result)
Then stop here, following command doesn't work:
prun.exe tmail.exe -transport "SMS" -to "1234567890" -body "TEST SMS"
prun.exe tmail.exe -transport "SMS" -to ""
prun.exe tmail.exe -to ""
and other combinations........
Do you have tips form me???

No one?

Lord Spectre said:
Thanks l3v5y, prun was a great application, but unfortunately it doesn't work.
Let me explain my test, first of all there's no necessary to specify \Windows directory, just using:
prun.exe tmail.exe
and then message screen popup on my phone.
Also I tried to run other program from desktop like "Slide To Unlock" and TomTom Navigator. GREAT! They work both!
Next step was try to going directly to SMS inbox:
tmail.exe -transport "SMS"
Sh*t! It doesn't work! And for sure other parameters doesn't work too...
Like: prun.exe tmail.exe -transport "SMS" -to "1234567890" -body "TEST SMS"
I tried with HTC Trinity and HTC Diamond....
UPDATE:
I tried multiple line commands, like:
prun.exe tmail.exe <= works (show me message window)
tmail.exe -transport "SMS" <= works (show me SMS service. I used also -service with same result)
Then stop here, following command doesn't work:
prun.exe tmail.exe -transport "SMS" -to "1234567890" -body "TEST SMS"
prun.exe tmail.exe -transport "SMS" -to ""
prun.exe tmail.exe -to ""
and other combinations........
Do you have tips form me???
Click to expand...
Click to collapse
try parameter -service "SMS" instead of -transport. It only opens new message with recipient and message body, but you have to tap send button to actually send it.
Edit. you can use sendsms.exe (have to be copied on the device) from smsSender to direct sending. it uses following parameters: sendsms.exe "recipient phone number" "message" [deliveryReport]
eg. sendsms.exe "12345678" "Test message!" true

Thanks a million avellant,
finally I can manage (automatically) SMS from my application (running on my desktop)...
But let me explain just one more issue, when I use:
prun.exe \sendsms.exe 1234567890 "TEST SMS" false
I receive SMS, but only with following text: "TEST"
Seem it truncate the rest!
Do you have solution?
And for sure... THANKS for CODE.... You know....

I'm guessing that prune.exe accepts only two parameters with the first one being the application you want to run, and the second one being optional parameters to run with that application.
Untested, but try this:
prun.exe "\Windows\tmail.exe" "-transport ""SMS"" -to ""1234567890"" -body ""TEST SMS"""
prun.exe "\sendsms.exe" "1234567890 ""Test SMS"" false"
Or perhaps try nesting each argument in quotes.
prun.exe "\Windows\tmail.exe" """-transport """"SMS"""""" ""-to """"1234567890"""""" ""-body """"TEST SMS"""""""
prun.exe "\sendsms.exe" """1234567890"" """"Test SMS"""" ""false"""
In a command terminal (and in good ol' DOS), the escape character was a carat.
prun.exe "\Windows\tmail.exe" "-transport ^"SMS^" -to ^"1234567890^" -body ^"TEST SMS^""
prun.exe "\sendsms.exe" "1234567890 ^"Test SMS^" false"
On that note, maybe prun.exe will behave properly without quotes around the entire set of parameters.
prun.exe "\Windows\tmail.exe" -transport ^"SMS^" -to ^"1234567890^" -body ^"TEST SMS^"
prun.exe "\sendsms.exe" 1234567890 ^"Test SMS^" false
Give those a whirl. Hopefully one of them works.

I just tested those. Looks like my initial idea was the correct one.
This worked for me just fine:
Code:
prun.exe "\sendsms.exe" "1234567890 ""Test SMS"" false"

You are absolutely right, prune.exe accepts only two parameters, now it works!!!
This forum rocks and users' skill are awesome!!!
Very very thanks to all !!! You save me!

BTW, if I can ask...
Using tmail.exe I can always send SMS, but I need to press "Send" button on PDA.
Is it possible to Send SMS with tmail.exe and without press any button on PDA?

Related

One click away from composing chosen type of message :)

Hi.
Sending message can be timeconsuming sometimes, ie. when you try to compose new SMS message if your last message was MMS, than selected account is MMS and hiting NEW/MESSAGE will bring up MMS composer.
But there is a simple way, by using tmail command line parameteres.
Examples:
simply going directly to SMS inbox is done by:
Code:
tmail.exe -transport "SMS"
opening new SMS composer window without recipient:
Code:
tmail.exe -transport "SMS" -to ""
creating new MMS with given recipient(s), subject, body and attachment:
Code:
tmail.exe -transport "MMS" -to "48689898665" -cc "48506325889" -bcc "[email protected]" -subject "simple subject" -body "simple MMS body" -attach "/My Documents/nice_chick.jpg"
etc.
The most convenient way of using above exaples are by creating shortcuts of course, but you must remember, that attributes must be placed inside quotation marks. They can't be (i think so escaped, so when creating shortcut remember to remove global line quotation.
Example:
This will NOT work:
Code:
#"\Windows\tmail.exe -transport "SMS" -to """
Code:
This will work:
#\Windows\tmail.exe -transport "SMS" -to ""
Happy hacking
is there a way to create a shortcut to a new e-mail message ?
thanks in advance.
Just use "POP3" as the transport..
this still doesn't work for me :-(
i'm using tmail.exe -transport "POP3" -to " "
which still opens a new blank text message
thanks for your help - much appreciated !
I can't get an .ink with the command for new-sms to work with my Hermes WM6.1..anyone know if there's a different command for the wm6.1 tmail.exe?
Jarek said:
Hi.
Sending message can be timeconsuming sometimes, ie. when you try to compose new SMS message if your last message was MMS, than selected account is MMS and hiting NEW/MESSAGE will bring up MMS composer.
But there is a simple way, by using tmail command line parameteres.
Examples:
simply going directly to SMS inbox is done by:
Code:
tmail.exe -transport "SMS"
opening new SMS composer window without recipient:
Code:
tmail.exe -transport "SMS" -to ""
creating new MMS with given recipient(s), subject, body and attachment:
Code:
tmail.exe -transport "MMS" -to "48689898665" -cc "48506325889" -bcc "[email protected]" -subject "simple subject" -body "simple MMS body" -attach "/My Documents/nice_chick.jpg"
etc.
The most convenient way of using above exaples are by creating shortcuts of course, but you must remember, that attributes must be placed inside quotation marks. They can't be (i think so escaped, so when creating shortcut remember to remove global line quotation.
Example:
This will NOT work:
Code:
#"\Windows\tmail.exe -transport "SMS" -to """
Code:
This will work:
#\Windows\tmail.exe -transport "SMS" -to ""
Happy hacking
Click to expand...
Click to collapse
Hasn't this been discussed on the Forum multiple times over and in multiple places. Well heck I know it has b/c your copy/pasting the examples out of those other threads to show your examples. In the process of being helpful, thank you; you are muddying up the forum.
CG.. you're wasting your breath.
this thread is from 19-07-2005 by the way..
I searched with google to try to find the answer to my problem, as I'm not a programmer and just one of the pplz who look for info on how to set up their device..

Newbie-Any idea to call the text message GUI?

I try to find a API or any other methods to call the SMS GUI and enter the receipt number automatically by my code?
Do you have any idea, please help me.
This is quite simple actually..... just call CreateProcess on tmail.exe with the following argument:
-service "SMS" -to "+4499999999" -body "Sample text"
That will start the SMS GUI and fill "+4499999999" as reciever and "Sample text" as the SMS text body.
Øystein
Check out:
http://www.teksoftco.com/forum/viewtopic.php?t=8
Regards,
Raul
It works, many thanks. t0flus's answer is for my question.
By the way, thanks for rain's link, it is just a sample code for mapi.

Command line to invoke incoming-sms and missed calls windows?

Can these folders be opened directly by a certain command? \Windows\cprog.exe unfortunately only openes the dial pad window and \Windows\tmail.exe openes the main window of pocketoutlook.
I'm planning to make a script for rltoday, that's what I need this for.
without knowing for sure maybe some parameters added to the tmail.exe
would open the spc folders in outlook
Rudegar said:
without knowing for sure maybe some parameters added to the tmail.exe
would open the spc folders in outlook
Click to expand...
Click to collapse
That is exactly, what I'm thinking. But I can't figure out, which parameters to use.
For inbox, try using:
tmail.exe -service "SMS"
It should open your inbox. At least it works for me.
To directly open the new sms window type:
tmail.exe -to "<number>" -body "hello" -service "SMS"
You can remove the parameters you don't need.
For email, replace "SMS" to "ActiveSync"
Marshall
Marshall07 said:
For inbox, try using:
tmail.exe -service "SMS"
It should open your inbox. At least it works for me.
To directly open the new sms window type:
tmail.exe -to "<number>" -body "hello" -service "SMS"
You can remove the parameters you don't need.
For email, replace "SMS" to "ActiveSync"
Marshall
Click to expand...
Click to collapse
It works! Have a million thanks. You don't happen to know how to call the "incoming/outgoing calls" window, do you?
Ok, found it. For anyone, who might be interested in the future and finds this thread:
VJPhoneShortcuts "CallHistory.exe" will help you.
paranoid2007 said:
It works! Have a million thanks. You don't happen to know how to call the "incoming/outgoing calls" window, do you?
Click to expand...
Click to collapse
I use VJPhoneShortcuts and it works good for that purpose.
Marshall
May I know the command line that can turn on/off the bluetooth/WIFI directly?
VJVolubilis should enable/disable bluetooth. I don't think it works with Wifi right now on some hardware.
V
Marshall07 said:
For inbox, try using:
tmail.exe -service "SMS"
It should open your inbox. At least it works for me.
To directly open the new sms window type:
tmail.exe -to "<number>" -body "hello" -service "SMS"
You can remove the parameters you don't need.
For email, replace "SMS" to "ActiveSync"
Marshall
Click to expand...
Click to collapse
The avobe command opens the message box. how to send the message automatically
mathanhere said:
The avobe command opens the message box. how to send the message automatically
Click to expand...
Click to collapse
I don't know if there is a way to autosend it with a shortcut...
Anyway you can write a script in MortScript or you can code a program to send an SMS with the Windows APIs...
Marshall

anyone create for me a new mms link with -bcc code?

i have a shap's rom and i want a shortcut "new mms" with -bcc code.
"\Windows\tmail.exe" -service "MMS" -to "" i want change -to wih -bcc but i don't know how i can do.
Thanks.
Lilhit82 said:
hi sorry for my english, i have a question for you.
you are the creator of tmail shortcut but they are only with command -to, i wish create mms shortcut with -bcc command but i don't know how i can do this.
Can you create for me a shortcut or said me how can i do?
Thanks for all.
Click to expand...
Click to collapse
Depends on your ROM and the version of Arcsoft MMS you're using. I believe some versions of Arcsoft MMS have combined SMS/MMS into one menu option, and as far as I know the shortcuts won't work for those versions. I have MMS Composer version 5.0.31.7, and it has the combined SMS/MMS. I've verified the shortcuts will not work for me. Possibly there are new commands....? Older versions (maybe the one you're using if you're still running Schap's ROM) might work if there is a separate SMS and MMS within Arcsoft.
Download yourself a copy of Total Commander (it's free). Save the MMS shortcut I posted into the Schap's forum. From Total Commander, select the MMS shortcut, and select Properties. Go to the Shortcut tab and edit the command line.
Here's an example to create a new MMS with recipients, subject, body text, and an attachment:
"\Windows\tmail.exe" -service "MMS" -to "1234567890" -cc "9876543210" -bcc "2468135790" -subject "Greetings" -body "Here is where I put my message" -attach "\My Documents\My Pictures\picture.jpg"
If that doesn't work, you can try changing the -service to -transport in the command line. I've seen both posted in the forums, not sure which is correct. But the -service has worked for me in the past. If none of this works then you might try a different version of Arcsoft MMS.
Hope this helps you. Good luck.
at the first i tell you that i have shap's rom end my mms composer version is 4.0.xx with mms and text message both separated.
I installed total commander, i changed in -bcc command without put a number...my thing was that when i opened mms link the imput bar go to bcc campus directly but after change the command is not happened.
but now i understand how can use total commander and i can create a particular shortcut like:
Here's an example to create a new MMS with recipients, subject, body text, and an attachment:
"\Windows\tmail.exe" -service "MMS" -to "1234567890" -cc "9876543210" -bcc "2468135790" -subject "Greetings" -body "Here is where I put my message" -attach "\My Documents\My Pictures\picture.jpg"
thanks for all and very very sorry for my bad english..is very difficult for me explain this.

tmail.exe -service argument to launch E-mail Inbox ?

Hi,
I'm using the Resco Explorer new v8 Today plug-in. It allows the user to select any .lnk file under \Windows\Start Menu\Programs\ as icons on the today screen.
I've created a .lnk file containing:
0#:MSINBOX -service "SMS"
.. which nicely jumps right in to the MS SMS app.
I want to create another .lnk file which will jump right in to the MS (pocket Outlook) Inbox, but I always end up at the Picker list.
What's the correct :MSINBOX -service "... string to get tmail.exe to jump right in to the pocket Outlook e-mail Inbox?
Thanks!
Jay
try:
\windows\tmail.exe -service "ActiveSync" -to ""
if you have named your email with another name, then replace ActiveSync accordingly.
Thanks so much Jolas!
I had guessed at Inbox, Outlook, tmail, and a variety of other "service" names. I simply never figured that it would be "ActiveSync"!
The actual link that I ended up using was simply
-service "ActiveSync"
(I didn't need to -to clause, as that launches the program in composer mode rather than in the Inbox).
Cheers,
Jay
What about
Take a look into my thread;
http://forum.xda-developers.com/showthread.php?t=623195
Within it is the basics of making your own shortcuts and it is the basis of adding your own icon or *.icl icon library..
Now and then I'm still updating (editing) it. I'm looking into two *.icl files, where I need to find out if I can share 'm here (that is within the above link).
Here an extract;
Available parameters for tmail.exe (depending on the service used) are;
"tmail.exe" -new ""
"tmail.exe" -service "" (e.g. "MMS" or "ActiveSync" or "SMS")
"tmail.exe" -to ""
"tmail.exe" -subject ""
"tmail.exe" -Body ""
"tmail.exe" -attach ""
"tmail.exe" -open "inbox"
"tmail.exe" -sync or combinations of all such as-
ex.
"Windows\tmail.exe" -service "Yahoo!" -to ""
"Windows\tmail.exe" -service "GMail" -to ""
Direct SMS (I called it SMS2.lnk);
51#"\Windows\tmail.exe" -service "SMS" -to "" -body ""
Direct link to Games directory;
60#"\Windows\fexplore.exe" Windows\Start Menu\Programs\Games
Know there's a lot more to know from this link
IMO this is a nice start libove
Senax

Resources