Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to send email with attachment in iOS and Android XE7?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 23 - Last Post: May 17, 2017 2:17 AM Last Post By: Francisco Peris
Adriano Santos

Posts: 55
Registered: 5/17/07
How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2015 4:23 AM
How to send email with attachment in iOS and Android XE7?

Thanks
--
Adriano
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2015 10:39 AM   in response to: Adriano Santos in response to: Adriano Santos
Adriano wrote:

How to send email with attachment in iOS and Android XE7?

What are you using to send an email in general? Are you using Indy, or something
else?

--
Remy Lebeau (TeamB)
Richard Stevens

Posts: 52
Registered: 5/1/00
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2015 3:44 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Personally, I'd like to know if it's possible to create an email with an attachment using ios's own email app?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2015 3:53 PM   in response to: Richard Stevens in response to: Richard Stevens
Richard wrote:

Personally, I'd like to know if it's possible to create an email with
an attachment using ios's own email app?

Yes, it is possible.

iOS email with attachment
http://cc.embarcadero.com/Item/28916

Sending an email from an iOS FireMonkey application
http://blogs.embarcadero.com/ao/2011/10/04/39133

Send Email from IOS and Andoid
http://codeverge.com/embarcadero.delphi.firemonkey/send-email-from-ios-and-andoid/1060177

--
Remy Lebeau (TeamB)
Richard Stevens

Posts: 52
Registered: 5/1/00
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 21, 2015 12:26 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you very much Remy,
Alejandro Rosa

Posts: 23
Registered: 10/30/09
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2015 10:22 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy

Sorry, me english is bad.

I have a same problem: how to send an email with attachments on iOS and Adnroid?.

I can send email without attachment using " http://mailto:".

I am googling but i didn't found a solution

Your links do not solve the problem. The first (iOS) is written for FreePascal and not compiled into XE7 . And the rest does not work with attachments.

Regards,

Remy Lebeau (TeamB) wrote:
Richard wrote:

Personally, I'd like to know if it's possible to create an email with
an attachment using ios's own email app?

Yes, it is possible.

iOS email with attachment
http://cc.embarcadero.com/Item/28916

Sending an email from an iOS FireMonkey application
http://blogs.embarcadero.com/ao/2011/10/04/39133

Send Email from IOS and Andoid
http://codeverge.com/embarcadero.delphi.firemonkey/send-email-from-ios-and-andoid/1060177

--
Remy Lebeau (TeamB)
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2015 10:51 AM   in response to: Alejandro Rosa in response to: Alejandro Rosa
Alejandro wrote:

I have a same problem: how to send an email with attachments on
iOS and Adnroid?.

I already showed you how to do it.

I am googling but i didn't found a solution

There are plenty of articles and examples floating around that demonstrate
how to accomplish this in iOS/Android with Delphi FireMonkey.

Your links do not solve the problem.

Yes, they do.

The first (iOS) is written for FreePascal

They are actually for both. For Dellphi, you might need this add-on piece:

13 iOS Components and 8 Demos
http://cc.embarcadero.com/Item/28635

and not compiled into XE7.

It is Pascal code. You can use it in Delphi.

And the rest does not work with attachments.

Yes, they do.

--
Remy Lebeau (TeamB)
Alejandro Rosa

Posts: 23
Registered: 10/30/09
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 27, 2015 1:18 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy, soy my english is bad.

I can not believe Embarcadero FMX not distribute a component that allows calling the form of composing a mail, platform independent. The sources that offer me download not compile, as I said before, because they are prehistoric, use something called FMI and is not compatible with the current FMX (units are called such FMX_Type instead of FMX.Type and do not recognize TLabels!!!).
Is incredible to have to struggle with these things when today send a mail should be one line code.

Remy Lebeau (TeamB) wrote:
Alejandro wrote:

I have a same problem: how to send an email with attachments on
iOS and Adnroid?.

I already showed you how to do it.

I am googling but i didn't found a solution

There are plenty of articles and examples floating around that demonstrate
how to accomplish this in iOS/Android with Delphi FireMonkey.

Your links do not solve the problem.

Yes, they do.

The first (iOS) is written for FreePascal

They are actually for both. For Dellphi, you might need this add-on piece:

13 iOS Components and 8 Demos
http://cc.embarcadero.com/Item/28635

and not compiled into XE7.

It is Pascal code. You can use it in Delphi.

And the rest does not work with attachments.

Yes, they do.

--
Remy Lebeau (TeamB)
Mike Margerum

Posts: 590
Registered: 12/1/99
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 28, 2015 6:52 AM   in response to: Alejandro Rosa in response to: Alejandro Rosa
On 4/27/15 4:18 PM, Alejandro Rosa wrote:
Remy, soy my english is bad.

I can not believe Embarcadero FMX not distribute a component that allows calling the form of composing a mail, platform independent. The sources that offer me download not compile, as I said before, because they are prehistoric, use something called FMI and is not compatible with the current FMX (units are called such FMX_Type instead of FMX.Type and do not recognize TLabels!!!).
Is incredible to have to struggle with these things when today send a mail should be one line code.

Sad because this is stupidly easy using native code. I just added an
email button to one of my view controllers yesterday:

MFMailComposeViewController *mailComposer =
[[MFMailComposeViewController alloc]init];
mailComposer.mailComposeDelegate = self;
[mailComposer setSubject:@"My subject"];
[mailComposer setMessageBody:@"My message body" isHTML:NO];
[self presentViewController:mailComposer animated:YES
completion:nil];

FMX feels very much like 80/20 to me. The first 80% goes great! then
you spend 80% of your time getting the last 20% done.

I cant believe FMX doesn't have owner draw grids and list boxes for god
sakes. Mobile needs them more than any platform. Maybe i'm missing
this feature? Hell I still use these in my VCL apps because it's easier
to render my non dataset grid this way instead of using slow and bloated
live bindings.

Mike Margerum

Posts: 590
Registered: 12/1/99
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 28, 2015 7:12 AM   in response to: Mike Margerum in response to: Mike Margerum
I cant believe FMX doesn't have owner draw grids and list boxes for god
sakes. Mobile needs them more than any platform. Maybe i'm missing
this feature? Hell I still use these in my VCL apps because it's easier
to render my non dataset grid this way instead of using slow and bloated
live bindings.

I think fmx does an "owner draw" kind of thing with the "OnGetValue" and
"OnSetValue" events. I think this will suffice.
Mike Margerum

Posts: 590
Registered: 12/1/99
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 28, 2015 6:49 PM   in response to: Mike Margerum in response to: Mike Margerum
I cant believe FMX doesn't have owner draw grids and list boxes for god
sakes. Mobile needs them more than any platform. Maybe i'm missing
this feature? Hell I still use these in my VCL apps because it's easier
to render my non dataset grid this way instead of using slow and bloated
live bindings.

My apologies to EMB. FMX live bindings actually work pretty well on a
desktop. I wasn't using the listbindsourceadapter correctly. I
haven't tested it on a mobile device yet.

Brian Hamilton ...

Posts: 556
Registered: 10/14/04
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 20, 2015 10:49 AM   in response to: Adriano Santos in response to: Adriano Santos
you can use Intents in Android
i.e uses the built in email
there are example how to do this (try googling)
I have this working myself
Alejandro Rosa

Posts: 23
Registered: 10/30/09
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 14, 2015 10:25 AM   in response to: Adriano Santos in response to: Adriano Santos
Adriano Santos wrote:
How to send email with attachment in iOS and Android XE7?

Thanks
--
Adriano

Hi Adriano,
I have the same problem.
Were you able to find a solution that works and is robust (return error codes , etc ) ?

Thanks,

A.
Bob Carson

Posts: 62
Registered: 10/8/04
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 27, 2015 3:44 PM   in response to: Adriano Santos in response to: Adriano Santos
I use Indy 10 to send and receive email with attachments with FireMonkey, and the only problem I have had is with iOS. The following apps use Indy 10 email and Delphi FireMonkey XE7 (some XE6):
Windows:
http://www.accessoryware.com/download/FileViewExp.exe
http://www.accessoryware.com/download/PhotoSnap6.9.exe
http://www.accessoryware.com/download/PhotoShowPro.exe
Macintosh:
http://www.accessoryware.com/download/FileViewMac.zip
http://www.accessoryware.com/download/PhotoSnapMac.zip
http://www.accessoryware.com/download/PhotoShowProMac.zip
Android:
https://play.google.com/store/apps/details?id=com.embarcadero.FileViewer&hl=en

I haven't tried with XE8 yet, but does Indy 10 work for iOS to received email. I couldn't get the same app that receives email under Windows, OSX, and android, to receive email under iOS (XE7) ?
Bob Carson

Posts: 62
Registered: 10/8/04
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 27, 2015 3:52 PM   in response to: Bob Carson in response to: Bob Carson
on Android, Net Viewer Lite has the email not File Viewer Express, and it is free:
https://play.google.com/store/apps/details?id=com.accessorymobil.NetViewerLite&hl=en
Alejandro Rosa

Posts: 23
Registered: 10/30/09
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 28, 2015 5:29 AM   in response to: Bob Carson in response to: Bob Carson
I think the best solution is to use the native form to compose mail (at least in the case of mobile ). It's crazy having to make a form from scratch, using the contact list , etc , etc.

Bob Carson wrote:
I use Indy 10 to send and receive email with attachments with FireMonkey, and the only problem I have had is with iOS. The following apps use Indy 10 email and Delphi FireMonkey XE7 (some XE6):
Windows:
http://www.accessoryware.com/download/FileViewExp.exe
http://www.accessoryware.com/download/PhotoSnap6.9.exe
http://www.accessoryware.com/download/PhotoShowPro.exe
Macintosh:
http://www.accessoryware.com/download/FileViewMac.zip
http://www.accessoryware.com/download/PhotoSnapMac.zip
http://www.accessoryware.com/download/PhotoShowProMac.zip
Android:
https://play.google.com/store/apps/details?id=com.embarcadero.FileViewer&hl=en

I haven't tried with XE8 yet, but does Indy 10 work for iOS to received email. I couldn't get the same app that receives email under Windows, OSX, and android, to receive email under iOS (XE7) ?
Francisco Peris

Posts: 91
Registered: 1/5/15
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2017 2:59 PM   in response to: Adriano Santos in response to: Adriano Santos
Adriano Santos wrote:
How to send email with attachment in iOS and Android XE7?

Thanks
--
Adriano

Sorry for writing in a so old thread...

However, I have spent many hours trying to send an email WITH ATTACHMENT. It was easy in Android using itents...but I cannot find the way to do it in iOS.

All the previous links do not compile...and I have tried more options. No one works...or no one works in Tokyo.

Any new ideas?

Thanks in advance.
loki loki

Posts: 787
Registered: 7/1/02
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2017 3:06 PM   in response to: Francisco Peris in response to: Francisco Peris
use MFMessageComposeViewController

- (BOOL)addAttachmentURL:(NSURL *)attachmentURL
withAlternateFilename:(nullable NSString *)alternateFilename

you can find the translation of the api to pascal in Alcinoe,
ALIosMessageUIApi.api


Sorry for writing in a so old thread...

However, I have spent many hours trying to send an email WITH ATTACHMENT. It was easy in Android using itents...but I cannot find the way to do it in iOS.

All the previous links do not compile...and I have tried more options. No one works...or no one works in Tokyo.

Any new ideas?

Thanks in advance.
Francisco Peris

Posts: 91
Registered: 1/5/15
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2017 3:20 PM   in response to: loki loki in response to: loki loki
loki loki wrote:
use MFMessageComposeViewController

- (BOOL)addAttachmentURL:(NSURL *)attachmentURL
withAlternateFilename:(nullable NSString *)alternateFilename

you can find the translation of the api to pascal in Alcinoe,
ALIosMessageUIApi.api


Sorry for writing in a so old thread...

However, I have spent many hours trying to send an email WITH ATTACHMENT. It was easy in Android using itents...but I cannot find the way to do it in iOS.

All the previous links do not compile...and I have tried more options. No one works...or no one works in Tokyo.

Any new ideas?

Thanks in advance.

Thanks for answering so fast.

However, I have been googleling your information and I have not found any interesting results.

Any link?
Dave Nottage

Posts: 1,850
Registered: 1/7/00
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2017 4:18 PM   in response to: Francisco Peris in response to: Francisco Peris
Thanks for answering so fast.

However, I have been googleling your information and I have not found any interesting results.

https://sourceforge.net/p/alcinoe/code/HEAD/tree/source/

--
Dave Nottage [TeamB]
Delphi Worlds blog: http://www.delphiworlds.com/blog
Roy Woll

Posts: 25
Registered: 11/26/06
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 18, 2017 7:04 PM   in response to: Francisco Peris in response to: Francisco Peris
If you are just attaching a bitmap, FireMonkey can already do this natively with its share action. Note that with Share, you can select Mail. There is also a demo of this included with Delphi. What kind of file are you attaching? If you are open to a 3rd party FirePower can also do this. It uses the sharing services to accomplish this and can attach other types of files besides bitmaps, and attach multiple files with a single share action.

-Roy
Shanil M

Posts: 62
Registered: 12/24/04
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2017 12:27 AM   in response to: Adriano Santos in response to: Adriano Santos
If you want to add multiple email attachments using android intents, I posted working code at the bottom of this thread.
http://stackoverflow.com/questions/28956563/how-to-send-email-with-attachment-using-default-android-email-app-delphi-xe7
Francisco Peris

Posts: 91
Registered: 1/5/15
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 19, 2017 4:26 AM   in response to: Adriano Santos in response to: Adriano Santos
Thanks for the answers!!

To clarify...the porblem I have is with iOS and with an attachment, a text file.

Now I have the info...but it does not not seem easy. If i have problems I will start a new thread.

Finally it was a good idea to revive this old thread :)
Francisco Peris

Posts: 91
Registered: 1/5/15
Re: How to send email with attachment in iOS and Android XE7?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 17, 2017 2:17 AM   in response to: Adriano Santos in response to: Adriano Santos
Adriano Santos wrote:
How to send email with attachment in iOS and Android XE7?

Thanks
--
Adriano

Hi again:

a new wonderful solution is available. And I checked that it works:

https://www.woll2woll.com/single-post/2017/04/24/Send-an-Email-with-an-Attachment-FireMonkey
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02