All Projects → bashkarev → Email

bashkarev / Email

Licence: mit
Faster MIME Mail Parser

Labels

Projects that are alternatives of or similar to Email

Php Mime Mail Parser
A fully tested email parser for PHP 7.2+ (mailparse extension wrapper).
Stars: ✭ 687 (+3515.79%)
Mutual labels:  email
Python O365
A simple python library to interact with Microsoft Graph and Office 365 API
Stars: ✭ 742 (+3805.26%)
Mutual labels:  email
Kanmail
📥 An email client that functions like a kanban board.
Stars: ✭ 833 (+4284.21%)
Mutual labels:  email
Deltachat Android
Email-based instant messaging for Android.
Stars: ✭ 705 (+3610.53%)
Mutual labels:  email
Lettre
a mailer library for Rust
Stars: ✭ 713 (+3652.63%)
Mutual labels:  email
Bootstrap Email
Bootstrap 4 (and soon 5) stylesheet, compiler, and inliner for responsive and consistent emails with the Bootstrap syntax you know and love.
Stars: ✭ 781 (+4010.53%)
Mutual labels:  email
K 9
K-9 Mail – Open Source Email App for Android
Stars: ✭ 6,327 (+33200%)
Mutual labels:  email
Postmark Java
Official Java client library for the Postmark HTTP API
Stars: ✭ 18 (-5.26%)
Mutual labels:  email
Notify
A dead simple Go library for sending notifications to various messaging services.
Stars: ✭ 727 (+3726.32%)
Mutual labels:  email
Node Dkim Key
DKIM (DomainKeys Identified Mail) Key
Stars: ✭ 5 (-73.68%)
Mutual labels:  email
Sendgrid Go
The Official Twilio SendGrid Led, Community Driven Golang API Library
Stars: ✭ 710 (+3636.84%)
Mutual labels:  email
Truemail
🚀 Configurable framework agnostic plain Ruby 📨 email validator/verifier. Verify email via Regex, DNS and SMTP. Be sure that email address valid and exists.
Stars: ✭ 717 (+3673.68%)
Mutual labels:  email
Dank Selfhosted
Automated solution for hosting email, web, DNS, XMPP, and ZNC on OpenBSD.
Stars: ✭ 800 (+4110.53%)
Mutual labels:  email
Nylas Mail
💌 An extensible desktop mail app built on the modern web. Forks welcome!
Stars: ✭ 24,653 (+129652.63%)
Mutual labels:  email
Sendgrid Csharp
The Official Twilio SendGrid Led, Community Driven C#, .NetStandard, .NetCore API Library
Stars: ✭ 835 (+4294.74%)
Mutual labels:  email
Imap
Object-oriented, fully tested PHP IMAP library
Stars: ✭ 678 (+3468.42%)
Mutual labels:  email
Sup
A curses threads-with-tags style email client (mailing list: [email protected])
Stars: ✭ 780 (+4005.26%)
Mutual labels:  email
React email editor
This project is experimental! It's my attempt to create visual email template editor using React+Redux+etc... tools stack.
Stars: ✭ 19 (+0%)
Mutual labels:  email
Clj Mandrill
A Clojure implementation of the Mandrill API
Stars: ✭ 16 (-15.79%)
Mutual labels:  email
Mailtrackerblocker
Email tracker, read receipt and spy pixel blocker plugin for macOS Apple Mail
Stars: ✭ 821 (+4221.05%)
Mutual labels:  email

Faster MIME Mail Parser

Faster MIME Mail Parser could be used to parse emails in MIME format.

Build Status

Usage

Basic usage is the following:

$file = fopen('path/to/file.eml', 'r');
$message = \bashkarev\email\Parser::email($file);

$message->textHtml();

$message->getParts();
$message->getAttachments();

Settings

There are settings available.

  • charset - character set to use. Should be specified in uppercase only. Default is UTF-8.

    \bashkarev\email\Parser::$charset = "WINDOWS-1251";
    
  • buffer - read buffer size in bytes. Default is 500000.

    \bashkarev\email\Parser::$buffer = 4096;
    

Attachments

There is attachments parsing support.

Saving attachments to files

Saving to files could be done as follows:

$file = fopen('path/to/file.eml', 'rb');
$message = \bashkarev\email\Parser::email($file);
foreach ($message->getAttachments() as $attachment) {
    $attachment->save('dir/' . $attachment->getFileName('undefined'));
}

Streaming attachment to output

In order to stream attachment to output directly you need to do the following:

$file = fopen('path/to/file.eml', 'rb');
$message = \bashkarev\email\Parser::email($file);
$attachment = $message->getAttachments()[0];
header("Content-Type: {$attachment->getMimeType()};");
header("Content-Disposition: attachment; filename=\"{$attachment->getFileName('undefined')}\"");
$attachment->getStream()->copy(fopen('php://output', 'c'));

message/partial

$block = \bashkarev\email\Parser::email([
    fopen('path/to/part.1.eml', 'rb'),
    fopen('path/to/part.2.eml', 'rb'),
]);
$block->getMessage();

message/rfc822

$file = fopen('path/to/file.eml', 'rb');
$container = \bashkarev\email\Parser::email($file);
$message = $container->getAttachments()[0]->getMessage();

message/feedback-report

$file = fopen('path/to/file.eml', 'rb');
$container = \bashkarev\email\Parser::email($file);
foreach ($container->getAttachments() as $attachment) {
    if ($attachment->getMimeType() === 'message/feedback-report') {
        /**
         * @var \bashkarev\email\messages\Feedback $feedback
         */
        $feedback = $attachment->getMessage();
        $feedback->getType(); // Feedback::TYPE_ABUSE ...
    }
}

message/external-body

Supported types: url, local-file, ftp.

FTP auth

$file = fopen('path/to/file.eml', 'rb');
$container = \bashkarev\email\Parser::email($file);
foreach ($container->getAttachments() as $attachment) {
    if ($attachment->getStream() instanceof \bashkarev\email\transports\Ftp) {
        /**
         * @var \bashkarev\email\transports\Ftp $transport
         */
        $transport = $attachment->getStream();
        $transport->username = 'username';
        $transport->password = '******';
        $attachment->save('dir/' . $attachment->getFileName('undefined'));
    }
}
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].