IOS Email Photo Attachment

Is there a way to attach a picture to an email in IOS?


You will need to use MFMailComposeViewController to attach pictures / files.

I think iOSkit has declares for MFMailComposeViewControlle.

1 Like

It looks like this is the solution but I have a few sticking points trying to get a picture attached. I basically want to take a photo from within the app and attach it to the email. I tried put a photo in the resources for testing until I add the camera code and it seems to show the right path but maybe the issue is IOSKIT is using Xojo.IO.Folderitem and I am using the latest XOJO where that is deprecated??

var p as text = SpecialFolder.Resource("Testpic2.png").NativePath.ToText
Var f As New Xojo.IO.FolderItem(p)

mailComposeView = new Extensions.MFMailComposeViewController
mailComposeView.setToRecipients Array("")
mailComposeView.setSubject "Test"
if f.Exists then
end if
mailComposeView.setMessage "This is a sample email"
mailComposeView.FinishCallback = WeakAddressOf SendResult

if Extensions.MFMailComposeViewController.canSendMail then
end if

Your too clever you already solved this one :slight_smile:

Deprecated ≠ gone. You’ll be good for a while.

1 Like