Send SMS via cemapi poom on Windows Mobile 6

Source: Internet
Author: User

Send SMS via cemapi poom on Windows Mobile 6

Third-party software on winodws mobile generally uses
1) Call the smsmessagesend API function to send text messages.
Or pass
2) CreateProcess or shellexecuteex method, call the command (excluding angle brackets)
</Windows/tmail.exe-service "SMS"-to "SMS receiver number"-Body "SMS content">

In the following example, we call the SMS program (tmail.exe) that comes with Windows mobile, and edit a text message with the recipient 10086, the text message content cxye, and the query balance.
/Windows/tmail.exe-service "text message"-to "10086"-Body "ktip1000"
The final result is as follows.
<Place holder for SMS send UI>

1) and 2) Both methods have their own advantages and disadvantages.
Method 1: After the SMS is successfully sent, the sent sms cannot be found in the sent items provided by Microsoft. No message is displayed if the message fails to be sent. Of course, you can hardline the poom text message object to achieve this.
In the second method, the tmail.exe-service "SMS"-to ""-Body "method cannot automatically send text messages, but it is stuck on the editing page. You also need to manually click" send, or through a program.

The following describes how to enable the text message to appear in the sent mail box or automatically send it after editing the text message.
This is to send text messages through cemapi. This article has been published in www.codeproject.com for years. Please refer to http://www.codeproject.com/KB/mobile/SMS_CEMPI.aspx for the original article.

I used and practiced this code and found several problems.
1) if the text message fails to be sent, the text message will be sent to the draft box, but the text message cannot be sent again after you click "change.
<Place holder for screen shot>
At this time, the text message content is placed on the subject, which is different from the situation encountered during normal use. The text message content should be in the body.
2) When sending a text message, you need to set a parameter, that is, the local number. It is very troublesome to obtain the local number.
3) This sample is compiled in EVC and the. RC2 file is missing. Although the author has explained how to solve the problem.

However, I have rewritten the following and changed all definitions such as ccomptr <imapisession> to the imapisession recommended on wm6.
Corrected the return value of the hresult type returned by the sendsmsmessage function: Return s_ OK.

But 1) and 2) the problem still needs to be solved.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/cjwn/archive/2009/02/08/3868466.aspx

 

Use the tmail.exe command parameter to send emails.

 

I recently learned about the tmail command parameters and want to publish emails in the program.

Let's download the command parameters of tmail.exe.

-Service-to-CC-bcc-body-subject-Attach

One by one explanation:

-Service: Select mail acount. Here, it can be SMS, MMS, ActiveSync or your e-mail acount.

How to get mail acount in the program. I am too lazy to write.

-The email to which the email is sent can be separated.

-CC copy to sb, same as above.

-BCC blind copy is the same as above.

-Body content.

-Subject subject

-Attach: The attachment must use an absolute path.

For example.

-Service/"ActiveSync/"-to/"qqiangsir.163.com/"-body/"E-mail content/"-subject/"test subjet/"-Attach/"// my documents ents // my pictures // heart.gif/

Simply call the tmail.exe process in the program.

Shellexecuteinfo Si;
Zeromemory (& Si, sizeof (SI ));
Si. cbsize = sizeof (SI );
Si. fmask = 0;
Si. hwnd = NULL;
Si. lpverb = NULL;
Si. lpfile = _ T ("// windows // tmail.exe ");
Si. nshow = sw_shownormal;

Cstring Param;
Param. format (_ T ("-service/" ActiveSync/"-to/" qqiangsir.163.com/"-body/" E-mail content/"-subject/" test subjet/"-Attach /"// my documents // my pictures // heart.gif /"));
Si. lpparameters = Param;

Shellexecuteex (& Si );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.