I want my app to be able to send an email with attachment to a hard-coded recipient with no user input required, unlike the MessageUI framework.
Is there any way to do this? Any example code would be appreciated.
Thanks in advance.
I want my app to be able to send an email with attachment to a hard-coded recipient with no user input required, unlike the MessageUI framework.
Is there any way to do this? Any example code would be appreciated.
Thanks in advance.
Apple doesn't give you a way to do this. You'll have to write your own IMAP library or use a 3rd-party library (Mailcore is good).
As Saurabh said, there is no low level mail library. I would look for an SMTP library, rather than an IMAP one, because you don't need to get mail, just sent it.
Attachments can be done with MFMailComposeViewController's via -(void)addAttachmentData:(NSData *)attachment mimeType:(NSString *)mimeType fileName:(NSString *)filename
Which I believe simply base64 encodes the data, and attached a mime type header and footer.
Check out this question for lots on the topic: http://stackoverflow.com/questions/740939/open-source-cocoa-cocoa-touch-pop3-smtp-library