- (void)sendSMS:(NSString *)bodyOfMessage recipientList:(NSArray *)recipients

{   
    MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];
   
    if([MFMessageComposeViewController canSendText])
    {
        controller.body = bodyOfMessage;  
        controller.recipients = recipients;
        controller.messageComposeDelegate = self;
        [self presentModalViewController:controller animated:YES];
    }
   
}

 

            NSArray * array = [[NSArray alloc]initWithObjects:phone, nil];
                       
           
            [self sendSMS:@"这里是短信内容" recipientList:array];

posted on 2012-07-26 15:38  chivas  阅读(272)  评论(0编辑  收藏  举报