All Projects → eikek → emil

eikek / emil

Licence: MIT license
Emil is a library for dealing with E-Mail in Scala.

Programming Languages

scala
5932 projects

Labels

Projects that are alternatives of or similar to emil

Enmime
MIME mail encoding and decoding package for Go
Stars: ✭ 246 (+1347.06%)
Mutual labels:  email
laravel-postal
This library integrates Postal with the standard Laravel mail framework.
Stars: ✭ 20 (+17.65%)
Mutual labels:  email
apiservices
.NET API services - Managed Push Notifications, Email Engine (Templates, loading, & sending), & Localization Abstractions
Stars: ✭ 25 (+47.06%)
Mutual labels:  email
Githubmonitor
根据关键字与 hosts 生成的关键词,利用 github 提供的 api,监控 git 泄漏。
Stars: ✭ 248 (+1358.82%)
Mutual labels:  email
email
Aplus Framework Email Library
Stars: ✭ 127 (+647.06%)
Mutual labels:  email
emailpyspam
A python 3+ program to spam emails to a list of users repetitively
Stars: ✭ 63 (+270.59%)
Mutual labels:  email
Mailyak
An elegant MIME/SMTP email library with support for attachments
Stars: ✭ 244 (+1335.29%)
Mutual labels:  email
mail
Actively maintained fork of gomail. The best way to send emails in Go.
Stars: ✭ 376 (+2111.76%)
Mutual labels:  email
nest-sendgrid
No description or website provided.
Stars: ✭ 24 (+41.18%)
Mutual labels:  email
ogham
Sending email, sms or whatever is a piece of cake
Stars: ✭ 19 (+11.76%)
Mutual labels:  email
Email Validation Tool
An easy to use, accurate-ish & extensible email validation library for PHP 7+ 📧
Stars: ✭ 250 (+1370.59%)
Mutual labels:  email
flutter mailer
A wrapper on top of MFMailComposeViewController from iOS and Mail Intent on android
Stars: ✭ 43 (+152.94%)
Mutual labels:  email
protocol
OpenCAP: Making Crypto Convenient
Stars: ✭ 32 (+88.24%)
Mutual labels:  email
Meli
🐝 experimental terminal mail client, mirror of https://git.meli.delivery/meli/meli.git https://crates.io/crates/meli
Stars: ✭ 242 (+1323.53%)
Mutual labels:  email
sesdashboard
Analytics and activity tracking dashboard for AWS Simple Email Service
Stars: ✭ 36 (+111.76%)
Mutual labels:  email
React Email Editor
Drag-n-Drop Email Editor Component for React.js
Stars: ✭ 3,131 (+18317.65%)
Mutual labels:  email
terraform-aws-ses-dashboard
This module will create a Deliverability Dashboard that shows information about SES Email bounces and complaints.
Stars: ✭ 20 (+17.65%)
Mutual labels:  email
egnature
Egnature is an email signature generator tool, which is an open source and free to use.
Stars: ✭ 26 (+52.94%)
Mutual labels:  email
matrix-email-bot
A bot that posts messages to rooms when an email is received.
Stars: ✭ 33 (+94.12%)
Mutual labels:  email
cerb-release
For over 20 years, teams of all sizes have used Cerb to manage their email workloads. Whether you're a solo founder replying to a few support messages per day, or a team with hundreds of members replying to thousands of messages per hour, you can serve your audience faster with Cerb's time-tested tools. Development at: https://github.com/jstande…
Stars: ✭ 37 (+117.65%)
Mutual labels:  email

Emil - Email without a

Build Status Scaladex Scala Steward badge

[\/] Emil is a library for working with E-Mail in Scala. The api builds on Cats and FS2. It comes with a backend implementation that is based on the well known Java Mail library. As such it is just another wrapper library, but also a bit different:

  • Extensible DSL for creating mails in code.
  • Conveniently send mails via SMTP.
  • Search mail boxes via IMAP.
  • The data structures model a simplified E-Mail structure. Instead of adhering to the recursive structure of a mime message, a mail here is flat, consisting of a header, a body (text, html or both) and a list of attachments.
  • The data structures and api are in a separate module, that doesn't depend on a concrete implementation library, like Java Mail. An implementation based on fs2-mail or even EWS can be created without affecting the user code of this library.

Write your e-mail related code once and then decide how to execute.

Usage

With sbt, add the dependencies:

"com.github.eikek" %% "emil-common" % "0.10.0-M2"  // the core library
"com.github.eikek" %% "emil-javamail" % "0.10.0-M2" // implementation module
// … optionally, other modules analog

Emil is provided for Scala 2.12, 2.13 and 3. Note: from 0.10.0 emil is builta against CE3. Also from this version onwards, support for scala3 has been added.

Examples

Send a mail (returning its messageID):

import cats.effect._
import cats.data.NonEmptyList
import emil._, emil.builder._
import emil.javamail._

val mail: Mail[IO] = MailBuilder.build(
  From("[email protected]"),
  To("[email protected]"),
  Subject("Hello!"),
  CustomHeader(Header("User-Agent", "my-email-client")),
  TextBody("Hello!\n\nThis is a mail."),
  HtmlBody("<h1>Hello!</h1>\n<p>This <b>is</b> a mail.</p>"),
  AttachUrl[IO](getClass.getResource("/files/Test.pdf")).
    withFilename("test.pdf").
    withMimeType(MimeType.pdf)
)

val myemil = JavaMailEmil[IO]()
val smtpConf = MailConfig("smtp://devmail:25", "dev", "dev", SSLType.NoEncryption)

val sendIO: IO[NonEmptyList[String]] = myemil(smtpConf).send(mail)

Searching for mails:

import java.time._
import cats.effect._
import emil._
import emil.SearchQuery._
import emil.javamail._

val myemil = JavaMailEmil[IO]()
val imapConf = MailConfig("imap://devmail:143", "dev", "dev", SSLType.NoEncryption)

def searchInbox[C](a: Access[IO, C], q: SearchQuery): MailOp[IO, C, SearchResult[MailHeader]] =
  for {
    inbox  <- a.getInbox
    mails  <- a.search(inbox, 20)(q)
  } yield mails


val q = (ReceivedDate >= Instant.now.minusSeconds(60)) && (Subject =*= "test")
val searchIO: IO[SearchResult[MailHeader]] = myemil(imapConf).run(searchInbox(myemil.access, q))

Documentation

More information can be found here.

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].