isliqian / Niceemail
Licence: mit
👷 一个简单易用的最小邮件发送库,支持注解。
Stars: ✭ 51
Programming Languages
java
68154 projects - #9 most used programming language
Labels
Projects that are alternatives of or similar to Niceemail
Emailobfuscator
Verschlüsselung von E-Mailadressen zum Schutz vor Spam
Stars: ✭ 34 (-33.33%)
Mutual labels: email
Brazilian Utils
Utils library for specific Brazilian businesses
Stars: ✭ 1,023 (+1905.88%)
Mutual labels: email
Dotmailer Magento2 Extension
The official Engagement Cloud for Magento2 extension
Stars: ✭ 33 (-35.29%)
Mutual labels: email
Laravel Mail View
Preview Laravel Mailables and notifications in your browser.
Stars: ✭ 41 (-19.61%)
Mutual labels: email
Sendria
Sendria (formerly MailTrap) is a SMTP server designed to run in your dev/test environment, that is designed to catch any email you or your application is sending, and display it in a web interface instead of sending to real world.
Stars: ✭ 30 (-41.18%)
Mutual labels: email
Mailerlite Api V2 Php Sdk
Official PHP wrapper for MailerLite HTTP API v2
Stars: ✭ 50 (-1.96%)
Mutual labels: email
Fiercephish
FiercePhish is a full-fledged phishing framework to manage all phishing engagements. It allows you to track separate phishing campaigns, schedule sending of emails, and much more.
Stars: ✭ 960 (+1782.35%)
Mutual labels: email
Postfwd Anti Geoip Spam Plugin
Postfwd plugin for blocking international spam botnets based on geographical location of IP addresses used to login to postfix via sasl.
Stars: ✭ 40 (-21.57%)
Mutual labels: email
Mum
A web-based user management tool for Postfix and Dovecot that is easy to use and still very powerful.
Stars: ✭ 31 (-39.22%)
Mutual labels: email
Nativescript Email
✉️ NativeScript plugin for opening draft e-mails
Stars: ✭ 45 (-11.76%)
Mutual labels: email
How to get emails imap tutorial
How to get emails including there attachments and how to extract various attributes from those emails. See https://youtu.be/zFEEGkvo6O8 for a more detailed information.
Stars: ✭ 30 (-41.18%)
Mutual labels: email
Cuttlefish
Transactional email server with a lovely web interface
Stars: ✭ 985 (+1831.37%)
Mutual labels: email
Weeklypedia
A weekly email update of all the most popular wikipedia articles
Stars: ✭ 50 (-1.96%)
Mutual labels: email
2018 Fake Mail Sender
PHP Fake Mail Sender Script with nicEditor - Send fake mails to anyone.
Stars: ✭ 43 (-15.69%)
Mutual labels: email
NiceEmail - 3.0.0
支持各种功能的邮件发送库
特性
- [x] 简洁的邮件发送API
- [x] 支持自定义发件人昵称
- [x] 支持邮箱发送验证码
- [x] 支持发送HTML/附件
- [x] 支持异步发送
- [x] 自定义注解,更加简单方便
如何使用
maven坐标
<dependency>
<groupId>io.github.isliqian</groupId>
<artifactId>NiceEmail</artifactId>
<version>3.0.0</version>
</dependency>
样例
@Before
public void before(){
// 配置,一次即可:邮箱与密码
NiceEmail.config(NiceEmail.SMTP_QQ(), "[email protected]", "jtmoybnwknrnbjha");
}
/**
* 测试发送文字
* @throws MessagingException
*/
@Test
public void testSendText() throws MessagingException {
NiceEmail.subject("这是一封测试TEXT邮件")//主题
.from("LqNice")//发件人昵称
.to("[email protected]")//收件人
.text("信件内容")//内容
.send();//发送
}
/**
* 测试发送Html
* @throws MessagingException
*/
@Test
public void testSendHtml() throws MessagingException {
NiceEmail.subject("这是一封测试HTML邮件")
.from("LqNice")
.to("[email protected]")
//html内容即可
.html("<h1>信件内容</h1>")
.send();
}
/**
* 测试附件邮件
* @throws MessagingException
*/
@Test
public void testSendAttach() throws MessagingException {
NiceEmail.subject("这是一封测试附件邮件")
.from("LqNice")
.to("[email protected]")
.html("<h1 font=red>信件内容</h1>")
//附近的路径,以及名称
.attach(new File("/Users/DELL/Pictures/Saved Pictures/000028.jpg"), "测试图片.jpeg")
//名称可以不设置
//.attach(new File("/Users/DELL/Pictures/Saved Pictures/000028.jpg"))
.send();
}
/**
* 测试发送验证码
* @throws MessagingException
*/
@Test
public void testSendVerifcationCode() throws MessagingException{
NiceEmail.subject("来自远方的验证码")
.from("LqNice")
.to("[email protected]")
//验证码长度为6,如果类型为null,验证码类型为数字英文混合验证码
.verificationCode(6,null)
//支持纯英文验证码
//.verificationCode(4,verificationEnglishArrary)
//如果验证码位数不配置,则按照6位验证码发送
//.verificationCode(0,verificationNumberArrary)
.send();
}
新特性
自定义注解如何使用 @AnnNiceConfig + @AnnNiceEmail
@AnnNiceConfig(type = "SMTP_QQ",
username = "[email protected]",
password = "jtmoybnwknrnbjha")
public class TestAnnEmail {
@Test
@AnnNiceEmail(subject = "测试注解发送文本邮件",
from = "LqNice",
to="[email protected]",
text = "text Ann text")
public void sendTextEmail() throws InvocationTargetException, IllegalAccessException, MessagingException {
send(TestAnnEmail.class);
}
@Test
@AnnNiceEmail(subject = "测试注解发送Html邮件",
from = "LqNice",
to="[email protected]",
html = "<h1>test Ann Html</h1>")
public void sendHtmlEmail() throws IllegalAccessException, MessagingException, InvocationTargetException {
send(TestAnnEmail.class);
}
}
###注意
在使用验证码的时候,如果第一次输入错误,下次发送会将位数加倍。。。。
###个人博客
作者 [email protected]
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].