1、using Microsoft.WindowsMobile.PocketOutlook;
2、OutlookSession m_outlookSession;
3、m_outlookSession = new OutlookSession();
4、// 构造短信息对象
SmsMessage msg = new SmsMessage(
txt_SendTo.Text.Trim(),
txt_SendTxt.Text);
// 使用OutlookSession中的SMS帐户进行发送
m_outlookSession.SmsAccount.Send(msg);
// 向用户提示发送成功的信息
MessageBox.Show(
"Your message has been sent.",
"Send",
MessageBoxButtons.OK,
MessageBoxIcon.Asterisk,
MessageBoxDefaultButton.Button1);
//捕获异常处理
catch (Exception ex)
{
MessageBox.Show(
String.Format("Error: {0}", ex.Message),
"Send",
MessageBoxButtons.OK,
MessageBoxIcon.Hand,
MessageBoxDefaultButton.Button1);
}