this is what i am using for mailing when clicked on
- (IBAction)email:(id)sender {
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
[mailViewController setSubject:@"Subject Goes Here."];
[mailViewController setMessageBody:@"Your message goes here." isHTML:NO];
[self presentModalViewController:mailViewController animated:YES];
[mailViewController release];
}
else {
NSLog(@"Device is unable to send email in its current state.");
}
now there was button for mail when i click on it then that view appear for compose mail so beside button there is one text field called _emailTextField so what i want is when clicked on button that text field should appear in compose mail view like if in textfield there is hell@yahoo.com then in mailview in TO it should be hell@yahoo as recipient
please tell me how to do that?
NSArray *recipentsArray = [[NSArray alloc]initWithObjects:@"xxx@gmail.com", nil];
[mailViewController setToRecipients:recipentsArray];
您可以使用 :
[mailViewController setToRecipients:[NSArray arrayWithObject: _emailTextField.text,nil]];
mailViewController.recipients = [NSArray arrayWithObjects:@"abc@xyz.com",nil];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.