Now we have a basic e-mail dialog up and running, but ideally what we want to do is attach the photo that we selected from our Photo Gallery to our new e-mail message. Luckily for us, Titanium makes this easy by exposing the
Ti.UI.createEmailDialog()method, which accepts the local path of the file we want to attach.
Adding an attachment is usually as simple as passing the location of the file or blob you wish to attach to the
addAttachment() method of
emailDialog. For example:
//add an image from the Resource/images directory emailDialog.addAttachment(Ti.Filesystem.getFile('/images/my_test_photo.jpg'));
Our case is a bit trickier than this, though. In order to successfully attach our chosen image, we ...