using Microsoft.WindowsMobile.PocketOutlook; /// <summary> /// 发送短信 /// <param name="tell">手机号</param> /// <param name="dictate">内容</param> /// </summary> public static void SendCharge(string tell, string dictate) { try { //构造短信息对象 OutlookSession ols = new OutlookSession(); //发送信息 SmsMessage sms = new SmsMessage(tell.Trim(),dictate.Trim()); ols.SmsAccount.Send(sms); MessageBox.Show("your message has been send!", "send", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } catch (Exception ex) { MessageBox.Show(ex.Message, "send", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1); } }
本文来自博客,转载请标明出处:http://blog.csdn.net/hxy2261/archive/2009/08/19/4464037.aspx
转载于:https://www.cnblogs.com/hxycn/archive/2009/08/19/1550109.html