I feel like I looked for *hours* trying to find a solution and nothing worked. Anyway, here's how I've managed to send a PDF *from a URL* as an attachment through an in-app email on iOS.

```
-(void)emailDocument:(id)sender {
    MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
    NSString *emailSubject = [NSString localizedStringWithFormat:@"Hi, I'm the subject"];
    [controller setSubject:emailSubject];

    NSString *path = @"http://www.somesite.com/document.pdf";
    NSURL *pdfURL = [NSURL URLWithString:path];
    NSData *pdfData = [NSData dataWithContentsOfURL:pdfURL];
    [controller addAttachmentData:pdfData mimeType:@"application/pdf" fileName:@"documentname.pdf"];

    //[controller setToRecipients:[NSArray arrayWithObject:[NSString stringWithString:@"YourEmail@me.com"]]];
    //[controller setMessageBody:@"Custom messgae Here..." isHTML:NO];

    [self presentModalViewController:controller animated:YES];
    controller.mailComposeDelegate = self;
    [controller release];
}

```

So my question is, are there any potential problems with this? And how would I go about error checking the data coming back?