Hi.
How I can send email from tablet x86? I can’t use Indy because no found correct files libcrypto.so and libssl.so for x86.
Please show C++ example how use Intent for sends email.
Thanks.
Moderator: 2ffat
Lena wrote:How I can send email from tablet x86?
Lena wrote:I can’t use Indy because no found correct files libcrypto.so and libssl.so for x86.
Lena wrote:Please show C++ example how use Intent for sends email.
1. use SMTP directly (which is what Indy does)
See How send email Android with c++ builder? on StackOverflow
Lena wrote:I use AndroidOpenssl1.0.1t from https://indy.fulgan.com/SSL/
On the devices arm everything works fine. The emails was successfully sent with Indy.
On tablet GT-P5200 x86 my application works well but can't send emails. I got:
Failed to load /data/data/com.embarcadero.Mikros/files/libssl.so
Lena wrote:Please could you explain how to add attachment file with Intent.
di_JFile AttachmentFile = TJFile::JavaClass->init(StringToJString(L"path to attachment file here"));
_di_Jnet_Uri Uri = TJnet_Uri::JavaClass->fromFile(AttachmentFile);
intent->putExtra(TJIntent::JavaClass->EXTRA_STREAM, TJParcelable::Wrap(((_di_ILocalObject)Uri)->GetObjectID()));
_di_JArrayList Uris = new TJArrayList;
di_JFile AttachmentFile = TJFile::JavaClass->init(StringToJString(L"path to attachment file here"));
_di_Jnet_Uri Uri = TJnet_Uri::JavaClass->fromFile(AttachmentFile);
Uris->add(Uri);
// repeat for each attachment...
intent->putParcelableArrayListExtra(TJIntent::JavaClass->EXTRA_STREAM, Uris);
#include <FMX.Helpers.Android.hpp>
void __fastcall TFormServis::Button3Click(TObject *Sender)
{
Button3->Enabled = false;
Application->ProcessMessages();
_di_JIntent intent;
//intent = new TJIntent; // <-- erorr no viable overloaded '='
intent = TJIntent::JavaClass->init();
intent->setAction(TJIntent::JavaClass->ACTION_SENDTO);
intent->setData(StrToJURI(L"mailto:" + String("lenailicheva@yandex.ru")));
// or: intent = TJIntent::JavaClass->init(TJIntent::JavaClass->ACTION_SENDTO, StrToJURI(L"mailto:" + address));
intent->setFlags(TJIntent::JavaClass->FLAG_ACTIVITY_NEW_TASK);
intent->putExtra(TJIntent::JavaClass->EXTRA_SUBJECT, StringToJString(L"Тест"));
intent->setType(StringToJString(L"message/rfc822"));
String path =
System::Ioutils::TPath::Combine(System::Ioutils::TPath::GetDocumentsPath(), L"mikros.s3db");
if(FileExists(path))
{
_di_JFile AttachmentFile = TJFile::JavaClass->init(StringToJString(path));
_di_Jnet_Uri Uri = TJnet_Uri::JavaClass->fromFile(AttachmentFile);
intent->putExtra(TJIntent::JavaClass->EXTRA_STREAM, TJParcelable::Wrap(((_di_ILocalObject)Uri)->GetObjectID()));
}
SharedActivity()->startActivity(intent);
Button3->Enabled = true;
}
Lena wrote:I got error on my device:
android.content.ActivityNotFoundExcrption: No Activity found to handle Intent
{act=abdroid.intent.action.SendTO typ=message/rfc822 flg=0x10000000(has extras)}.
That error means you don't have an app installed that allows sending an email via a SENDTO intent.
Lena wrote:Do You mean Project->Options->Uses Permitions?
Users browsing this forum: No registered users and 22 guests