In the past, I struggled for 2 evenings on this one, trying countless ways, some sort of worked some didn't. In the end, as usual it was less than 10 lines. Here is a simple way of doing it.
NSString *imageURL = [NSString stringWithFormat:@"http://www.website.com/images/%@",imagename];NSData* imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageURL]]; NSImage *imageFromWeb = [[NSImage alloc] initWithData:imageData]; NSString *body=@"A Word-A-Maze puzzle has been created for you. Enjoy."; NSArray *shareItems=@[body,imageFromWeb]; NSSharingService *service = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail]; service.recipients=@[@""];service.subject= @"Your Word-A-Maze Puzzle"; [service performWithItems:shareItems];
NSString *imageURL = [NSString stringWithFormat:@"http://www.website.com/images/%@",imagename];NSData* imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:imageURL]]; NSImage *imageFromWeb = [[NSImage alloc] initWithData:imageData]; NSString *body=@"A Word-A-Maze puzzle has been created for you. Enjoy."; NSArray *shareItems=@[body,imageFromWeb]; NSSharingService *service = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail]; service.recipients=@[@""];service.subject= @"Your Word-A-Maze Puzzle"; [service performWithItems:shareItems];