Code Monkey home page Code Monkey logo

gmail-sender-helper's Introduction

This library help you to sent email by gmail

Android Arsenal

Download

Setup

  1. Add to build.gradle in app level
implementation 'com.github.tntkhang:gmail-sender-library:1.3.0'
  1. How to use it
   GMailSender.withAccount("[email protected]", "email-password")
                .withTitle(title)
                .withBody(body)
                .withSender(getString(R.string.app_name))
                .toEmailAddress(emailAddress) // one or multiple addresses separated by a comma
                .withListenner(new GmailListener() {
                    @Override
                    public void sendSuccess() {
                        Toast.makeText(MainActivity.this, "Success", Toast.LENGTH_SHORT).show();
                    }

                    @Override
                    public void sendFail(String err) {
                        Toast.makeText(MainActivity.this, "Fail: " + err, Toast.LENGTH_SHORT).show();
                    }
                })
                .send();
  1. IMPORTANT ! Enable less secure for the email using to sent email: https://support.google.com/accounts/answer/6010255?hl=en
  2. Add those line into pro-guard
# Required for GmailSender
-dontwarn java.awt.**
-dontwarn java.beans.Beans
-dontwarn javax.security.**
-keep class javamail.** {*;}
-keep class javax.mail.** {*;}
-keep class javax.activation.** {*;}
-keep class com.sun.mail.dsn.** {*;}
-keep class com.sun.mail.handlers.** {*;}
-keep class com.sun.mail.smtp.** {*;}
-keep class com.sun.mail.util.** {*;}
-keep class mailcap.** {*;}
-keep class mimetypes.** {*;}
-keep class myjava.awt.datatransfer.** {*;}
-keep class org.apache.harmony.awt.** {*;}
-keep class org.apache.harmony.misc.** {*;}
  1. Enjoy

Checkout example if you need a demo.

gmail-sender-helper's People

Contributors

iftalab avatar tntkhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gmail-sender-helper's Issues

Warning : very risky to use

Hi everyone, Hi @tntkhang.

This post is written on 12th December, just to make people know about an important issue with this version.

To use this Gmail email sender, you need to use your email address and password (it makes sense).

GMailSender.withAccount("[email protected]", "email-password")

However, this is a huge problem, I explain myself :

If you put your password in a non-encoded format as it is specified in order to user this helper, be aware that if you release your APK on the public Google Play Store, it will be possible to analyse your APK.

I'm often analyzing APK in order to find some security breaches, and for sure I'll be able to see in a clear format both email and password, meaning that I'll have full access to your gmail account (and maybe more services if you use this password somewhere else).

So far, I really advice you either to not use this version of helper until @tntkhang find a way to fix it or to use a simple password on a brand new gmail account that doesn't really matter to you if it gets hack (but still very risky).

I don't post it to destroy this repo because basically if I'm there, it's because it's filling up one of my need, but I wouldn't use this version.

Unknown SMTP host: smtp.gmail.com

javax.mail.MessagingException: Unknown SMTP host: smtp.gmail.com;
nested exception is:
java.net.UnknownHostException: smtp.gmail.com

I less secured gmail.but get this error

small correct in project description

instead of "This library help you to sent email to gmail "

it should be
"This library will help you to sent email from Gmail"

Thanks for the library. working well

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.