Lena wrote:I want to add a button to my application by clicking on which I could send the database mikros.s3db to correct email.Is that possible?

Indy implements the SMTP protocol for sending emails (the TIdSMTP componet). So your app would have to configure it with an external SMTP server (GMail, Yahoo, etc) and user account authentication so your mobile app can connect to it. Different servers have different requirements about authentication, encryption, etc.

Indy does not have any integration with any iOS/Android native email APIs for sending emails with a mobile device's own email setups.

There are plenty of TIdSMTP examples floating around online if you search around. And there are even several discussions on this same BCBJ forum related to TIdSMTP.

On Android, it is probably best not to use SMTP directly, though. The user is likely to expect using an email account already installed on the device. So you should trigger an Android ACTION_SENDTO Intent containing your email data, and let Android prompt the user which email app+account to send the email with.

Today I try TIdSMTP for Windows. No problem.Which files for Android app I must download from this page: http://indy.fulgan.com/SSL/AndroidOpenssl1.0.1t.zip AndroidOpenssl1.0.2h.zip OpenSSL 1.0.2g Android.zip?How correct add this files in Android app just Add->To project libssl.so and libcrypto.so ?

You should NEVER use the OnCreate event in C++. Use the actual constructor instead.

Lena wrote:Do I need use TidAntiFreeze when I use TIdSMTP in Andoid app?

Honestly, I don't know how well (if at all) TIdAntiFreeze works cross-platform. But either way, you are not supposed to block the main UI thread anyway. You should use TIdSMTP in its own worker thread instead.

Lena wrote:Oops no component TidAntiFreeze in С++ Builder Berlin.

There is a design flaw in how Indy packages TIdAntiFreeze that causes issues, so TIdAntiFreeze is disabled in the IDE for FireMonkey projects. But you can still create an instance of TIdAntiFreeze in code at runtime instead, and it will function the same as if you had dropped it on a Form at design-time.

To specify a charset used for encoding an email's top-level headers, like Subject, you have to use the TIdMessage::OnInitializeISO event, not the TIdMessage::Charset property (message parts have their own local Charset property instead). In Delphi/C++Builder 2009+, Indy uses UTF-8 by default, you should stick with that. For Russian/Cyrillic, you could use KOI8-R if not UTF-8, but I would not suggest using Windows-1251 either way.

I could see that happening if Edit2->Text contained non-ASCII characters, but there is no way it could be converting "tracklogic" to "????", and certainly not with the code you have shown. There is no way it could even go from 10 ASCII characters to 4 '?' characters anyway.

BTW, Recipients->Add() returns a TIdEmailAddressItem*, so you don't need to index into Recipients->Items[0] for each sub-property value. And there is no reason to use the Address or Text property if you are using the User and Domain properties, and vice versa. So, use either:

That is a Windows-specific constant. It is defined in winnt.h, which is included by windows.h. You can't use Windows LANGIDs in Android, and besides the SysLocale.PriLangID field is not even used on non-Windows platforms.

Even if it were used, setting SysLocale.PriLangID to LANG_RUSSIAN causes the TIdMessage::OnInitializeISO event to default the charset to KOI8-R (LANG_UKRAINIAN defaults to Windows-1251). If you set the charset explicitly instead, you don't need to set SysLocale.PriLangID at all.