IPhone - how can I embed images into email from my application?

Can I insert images sent by email from my application? Can we have a source tag as an image in our application?

Thanks.

+1


source to share


2 answers


Yes. Using the 3.0 post API you can.

I will not enter the code here because it is under the NDA. However, this is well documented in the SDK. You need to get the image data in NSData, which is not so explicitly documented:



NSData* imageData = UIImagePNGRepresentation(myUIImage);

      

+1


source


The short answer is that you cannot.

Long answer - I just stumbled upon this one which includes the TTMessageController class. You will need to add a delegate to actually do the dispatch, i.e. Implement SMTP and talk to a well-known SMTP server. It's not too difficult on its own, but it adds some complexity with regard to error handling, especially since there is no background processing.



For example, if your application exits before you sent the email, you will need to remember your state and send it the next time you start. Apple's mail app will just send it in the background.

0


source







All Articles