无意发送电子邮件

Send email without intent

我想问是否有一种方法可以在 Android Studio 中从我的应用程序自动发送电子邮件,而无需使用“Intent.ACTION_SEND”打开 Gmail,也无需在 Google 账户设置。我的应用程序已经有一个与 Firebase 项目相关联的 Google 登录方法。

可以吗


是的,这是可能的。 web.You 上有几十年的图书馆应该已经尝试过一段时间了。

如何实施


你应该使用 this library.Code 下面给出

SendMail mail = new SendMail("youremail@email.com", "yourEmailsPass",
    "otherUser'sEmail@email.com",
    "Title",
    "Yes, it's working well\nI will use it always.:)");
mail.execute();

参考资料


  1. Github
  2. Youtube

谈到 Firebase 和向用户发送电子邮件时,最好的选择是使用 Trigger Email Extension from Firebase。无需打开您的 Gmail 帐户即可发送电子邮件。要实施扩展,请按照以下文章中说明的步骤操作: