复制代码 代码如下:
public void sendServiceSms(Context mContext,String content) {
try {
SmsManager manager = SmsManager.getDefault();
PendingIntent sentIntent = PendingIntent.getBroadcast(mContext, 0,
new Intent(SMS_SENT_TEST_ACTION), 0);
manager.sendTextMessage("13912345670", null, content, sentIntent, null);
} catch (Exception e) {
e.printStackTrace();
}
}
参数说明
sendTextMessage(String destinationAddress, String scAddress, String text, PendingIntent sentIntent, PendingIntent deliveryIntent):
destinationAddress:接收方的手机号码
scAddress:发送方的手机号码
text:信息内容
sentIntent:发送是否成功的回执,
DeliveryIntent:接收是否成功的回执。