In the button press.
NSString *someText = @"This is a blurb of text I highlighted from a document.";
SHKItem *item = [SHKItem text:someText];
[item setCustomValue:@"your@recipient.com" forKey:@"toField"];
// Share the item
[SHKMail shareItem:item];
The add these lines in SHKMail.m in the method sendMail:
[mailController setSubject:item.title];
[mailController setMessageBody:body isHTML:YES];
// **start of added code
NSString *recipient = [item customValueForKey:@"toField"];
NSLog(@"recipient: %@", recipient);
if (recipient != nil) {
NSArray *recipients = [[NSArray alloc] initWithObjects:recipient, nil];
[mailController setToRecipients:recipients];
[recipient release];
[recipients release];
}
// **end of added code
[[SHK currentHelper] showViewController:mailController];
No comments:
Post a Comment