Sending an image in a faceless email

Posted by anurag on Stack Overflow See other posts from Stack Overflow or by anurag
Published on 2010-06-01T11:58:46Z Indexed on 2010/06/01 12:33 UTC
Read the original article Hit count: 171

Filed under:
|
|

I am trying to send a faceless email (sending an email without showing the interface), using the code below.

I also want to attach an image to this email.

Is this possible?

- (void) sendEmailTo:(NSString *)toStr withSubject:(NSString *)subjectStr withBody:(NSString *)bodyStr
{
    NSString *emailString=[[NSString alloc] initWithFormat:@"mailto:?to=%@&subject=%@&body=%@",
                           [toStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
                           [subjectStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding],
                           [bodyStr stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:emailString]];

    [emailString release];
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c