All Projects → mailhu → emailkit

mailhu / emailkit

Licence: Apache-2.0 License
EmailKit for Android - This is a powerful, excellent and simple Email framework💌.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to emailkit

Gradlewiki
关于Gradle编译你需要知道的一切
Stars: ✭ 174 (+75.76%)
Mutual labels:  gradle, wiki
plugin-yml
A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project
Stars: ✭ 42 (-57.58%)
Mutual labels:  gradle
javacard-gradle-template
JavaCard project template for building CAP and running JCardSim with gradle + coverage
Stars: ✭ 27 (-72.73%)
Mutual labels:  gradle
gradle-libraries-plugin
No description or website provided.
Stars: ✭ 29 (-70.71%)
Mutual labels:  gradle
XTCP
一个便捷的TCP消息包拼装和解析框架
Stars: ✭ 20 (-79.8%)
Mutual labels:  gradle
gradle-screen-record
A GIF recorder, based on gradle script to record screen in Android Device, and the record (XXX.gif) will be auto uploaded to your PC.
Stars: ✭ 19 (-80.81%)
Mutual labels:  gradle
AndroidDevTools
收集整理Android开发所需的Android SDK、开发中用到的工具、Android开发教程、Android设计规范,免费的设计素材等。
Stars: ✭ 7,284 (+7257.58%)
Mutual labels:  gradle
gradle-multi-project-support
A collection of Gradle plugins to maintain the multi-project or multi-application in the mono-repo.
Stars: ✭ 63 (-36.36%)
Mutual labels:  gradle
broom
A disk cleaning utility for developers.
Stars: ✭ 38 (-61.62%)
Mutual labels:  gradle
Allomancy
Brandon Sanderson's Allomancy, now in Minecraft
Stars: ✭ 18 (-81.82%)
Mutual labels:  gradle
wiki
Free and Open Source Wiki built on top of Frappe
Stars: ✭ 63 (-36.36%)
Mutual labels:  wiki
ojaynico-kotlin-react-native
Kotlin Wrapper for React Native Components and APIs
Stars: ✭ 14 (-85.86%)
Mutual labels:  gradle
wiki
KISS Linux - Wiki (The wiki is now a part of the website)
Stars: ✭ 27 (-72.73%)
Mutual labels:  wiki
wikicr
Wiki in crystal, using Markdown and Git, inspired by dokuwiki. Last features to build are pretty hard, if you have some time to help... :)
Stars: ✭ 20 (-79.8%)
Mutual labels:  wiki
jooq-plugin
Plugin for generating jOOQ classes using dockerized databases
Stars: ✭ 55 (-44.44%)
Mutual labels:  gradle
RocketXPlugin
🔥🔥 android 端编译加速插件🚀 自动识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,加速 Android apk 的编译速度。
Stars: ✭ 408 (+312.12%)
Mutual labels:  gradle
King.Azure.Imaging
Image API & processing for Azure Web Apps
Stars: ✭ 20 (-79.8%)
Mutual labels:  wiki
manon
🧪 Play with SpringBoot 2, JWT, Querydsl, GraphQL, Docker, ELK, PostgreSQL, MariaDB, Redis, MongoDB, Flyway, Maven, Gradle, TestNG, JUnit5, JaCoCo, GreenMail, CI, Quality Gates, Prometheus, Gatling, etc.
Stars: ✭ 26 (-73.74%)
Mutual labels:  gradle
owl2neo4j
Convert OWL to labeled property graph and import into Neo4J
Stars: ✭ 42 (-57.58%)
Mutual labels:  gradle
gradle-console-reporter
Gradle plugin to report various kinds of summaries to console.
Stars: ✭ 49 (-50.51%)
Mutual labels:  gradle

EmailKit for Android

EmailKit for Android是以JavaMail类库为基础进行封装的框架,它比JavaMail更简单易用,在使用它开发电子邮件客户端时,还能避免对电子邮件协议不熟悉的烦恼。目前EmailKit支持的电子邮件协议有SMTP和IMAP,它支持的功能有发送邮件,下载附件、获取文件夹列表、读取邮件、加载邮件、同步邮件,对邮件消息的移动,删除,保存到草稿箱等操作,同时支持邮箱的新邮件消息推送(需要邮件服务器支持相关命令),邮件搜索等功能。把它依赖到你的Android项目中,你只需简单配置邮件服务器的参数,再使用这些简易的接口,即可完成你所需的功能,所见即所得。

效果图

效果图中的示例程序是使用EmailKit框架编写的邮箱客户端,示例程序的源码在本项目的app模块中。因时间原因,所以我只完成示例程序中的邮件服务器配置、发送邮件、加载邮件、同步邮件、查看邮件、下载附件这些基础功能,希望体谅。

服务器设置 邮箱文件夹列表 写邮件
收件箱列表 垃圾箱列表 查看邮件内容

文档链接

  • EmailKit最新文档,请到Wiki里仔细耐心地查阅 最新文档
  • 若你对该框架有什么疑问或提issues前可以先查看一下 FAQ
  • 4.x版本代码和文档改动较大,需要查阅3.x文档请点击 这里
  • 2.x版本的文档已没太大意义,仅做考古使用,点击进入 考古
  • 你想了解这个框架的历史,可以查看 更新日志

安装引入

步骤一、将JitPack存储库添加到根目录的build.gradle中:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

步骤二、在项目的app模块下的build.gradle里加:

dependencies {
    implementation 'com.github.mailhu:emailkit:4.2.1'
}

注:因为该库内部使用了Java 8新特性,可能你的项目依赖该框架在构建时出现如下错误:

Invoke-customs are only supported starting with Android O (--min-api 26)

你可以在项目的app模块下的build.gradle里加添如下代码:

android {
    ...
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

简单示例

以下代码是展示如何发送一封简单的电子邮件。若想了解框架的更多功能,请查阅Wiki文档。

//初始化框架
EmailKit.initialize(this);

//配置发件人邮件服务器参数
EmailKit.Config config = new EmailKit.Config()
        .setMailType(EmailKit.MailType.FOXMAIL)     //选择邮箱类型,快速配置服务器参数
        .setAccount("[email protected]")             //发件人邮箱
        .setPassword("password");                   //密码或授权码

//设置一封草稿邮件
Draft draft = new Draft()
        .setNickname("小学生")                      //发件人昵称
        .setTo("[email protected]")                        //收件人邮箱
        .setSubject("这是一封测试邮件")             //邮件主题
        .setText("Hello world !");                 //邮件正文

//使用SMTP服务发送邮件
EmailKit.useSMTPService(config)
        .send(draft, new EmailKit.GetSendCallback() {
            @Override
            public void onSuccess() {
                Log.i(TAG, "发送成功!");
            }

            @Override
            public void onFailure(String errMsg) {
                Log.i(TAG, "发送失败,错误:" + errMsg);
            }
        });

混淆

-dontwarn com.sun.**
-dontwarn javax.mail.**
-dontwarn javax.activation.**
-keep class com.sun.** { *;}
-keep class javax.mail.** { *;}
-keep class javax.activation.** { *;}
-keep class com.smailnet.emailkit.** { *;}

致谢

示例程序中所用到的开源库、框架和图像资源,在此致谢!

作者留言

目前作者是靠课余时间来开发和维护这个框架,如果有什么需求和问题可以提issues或通过邮件联系我。因学业繁忙和能力有限,大家提的需求和问题不一定很快解决和给出答复,希望大家体谅和包涵。

E-mail:[email protected]

License

Copyright 2018 张观湖

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].