Comprehensive mailing tools for PHP

Overview

Swift Mailer

Swift Mailer is a component based mailing solution for PHP. It is released under the MIT license.

Swift Mailer is highly object-oriented by design and lends itself to use in complex web application with a great deal of flexibility.

For full details on usage, read the documentation.

Sponsors

Comments
  • Broken pipe in StreamBuffer.php on line 236

    Broken pipe in StreamBuffer.php on line 236

    Hey guys, does anyone possibly know what could be causing this issue to happen?

    PHP Notice:  fwrite(): send of 41 bytes failed with errno=32 Broken pipe in /var/www/ACME/releases/20140602200156/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php on line 236
    

    I'm sending the email from a worker (gearman message queue, daemonized by supervisord) and I'm using Symfony ~2.4, swiftmailer-bundle ~2.3 (swiftmailer 5.1).

    When I restart the worker from supervisorctl the email is sent.

    I appreciate any help. Thanks.

    opened by juanmaia 87
  • #403 - Use of EmailValidator for versions of PHP >= 5.3

    #403 - Use of EmailValidator for versions of PHP >= 5.3

    See #403 I've not found a way to create a bridge class for using the EmailValidator in PHP 5.2 because of the namespaces. This fix allows for the use of the lib if you are using PHP 5.3 and leaves the usage of the previous validation otherwise.

    opened by egulias 61
  • Swift_MailTransport deprecated

    Swift_MailTransport deprecated

    Hello,

    The constructor Swift_MailTransport is deprected

    $transport = \Swift_MailTransport::newInstance();
    

    But on your documentation (http://swiftmailer.org/docs/sending.html) you use this constructor.

    What is the good way ?

    Thanks

    opened by babeuloula 48
  • S/MIME Signer and Encryption support

    S/MIME Signer and Encryption support

    This adds the S/MIME Signer for signing and encrypting messages. It largely includes the work done by Xavier De Cock (original signer implementation) and @Romain-Geissler.

    Related to: #11

    opened by sstok 44
  • Address in mailbox given does not comply with RFC 2822, 3.6.2.

    Address in mailbox given does not comply with RFC 2822, 3.6.2.

    When i try to send a newsletter i have this error : Address in mailbox given [[email protected]
] does not comply with RFC 2822, 3.6.2.

    I don't understand what is wrong because this address realy exist...

    opened by fabienlege 35
  • DKIM is failing when using swift mailer to sign emails, but works when I use http://php-dkim.sourceforge.net/

    DKIM is failing when using swift mailer to sign emails, but works when I use http://php-dkim.sourceforge.net/

    I downloaded php-dkim from http://php-dkim.sourceforge.net/ and tried to test from same privatekey, domain and selector i am using for swift mailer. That works perfectly, dkim is passed and shows mails signed-by pankajgarg.in But when I do same with swift mailer, DKIM test is failed.

    Code I am using to sign emails using Swift Mailer

    $SwiftMessage = \Swift_Message::newInstance();
            $SwiftMessage->setFrom(['[email protected]'])
                         ->setTo(['[email protected]])
                         ->setSubject('Check DKIM Status')
                         ->setBody('Check DKIM Status == passed ? hurray :) : alas :(');
    
    $privateKey = ''; // Generated one as the paired public key is set in DNS
    $domain = 'pankajgarg.in';
    $selector = 'pankaj1';
    
    $SwiftMessage ->attachSigner((new \Swift_Signers_DKIMSigner($privateKey, $domain, $selector))->setBodyCanon('simple')                                                                                                           ->setHeaderCanon('relaxed')                                                                                                         ->setHashAlgorithm('rsa-sha1'));
    
    $MailTransport = \Swift_MailTransport::newInstance();
    $Swift         = \Swift_Mailer::newInstance($MailTransport);
    
    $result = $Swift->send($SwiftMessage);
    

    Please suggest, how can I achieve that

    opened by pankaj-garg 33
  • Compilation failed: internal error: previously-checked referenced subpattern not found

    Compilation failed: internal error: previously-checked referenced subpattern not found

    While using swiftmailer with apache 2, php 5.4.7 (XAMPP 1.8.1) I get the following warning and fails to deliver the message:

    preg_match(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 4246
    
    at swiftmailer/library/classes/Swift/Mime/Headers/MailboxHeader.php on line 306
    

    The regexp in question is the following:

    /^(?:(?:(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?: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?[ \t])))?\[((?:(?:[ \t]*(?:\r\n))?[ \t])?(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x5A\x5E-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])))*?(?:(?:[ \t]*(?:\r\n))?[ \t])?\](?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?))))$/D
    

    The problem only occurs when the page is served through apache. When I run a copy the regexp to a test file and validate against that, it does not issue the warning.

    I have temporarily "solved" the problem by removing the validation altogether. However, I hope there is a better solution.

    Thank you!

    opened by ontonto 32
  • Error Expected response code 250 but got code

    Error Expected response code 250 but got code "", with message "" when $_SERVER['SERVER_NAME'] has unsupported symbols by RFC

    | Q | A | ------------------- | ----- | Bug report? | yes | Feature request? | no | RFC? | yes | How used? | Symfony | Swiftmailer version | 5.4.8 | PHP version | 7.1

    Observed behaviour

    Got error

    Expected response code 250 but got code "", with message ""

    when variable $_SERVER['SERVER_NAME'] contains asterisk '*' and use smtp transport.

    Expected behaviour

    Maybe throw exception, when SERVER_NAME contains asterisk or symbols not accepted by RFC for domain address. I'm not sure.

    Example

    Nginx has config: server_name *somedomain.tld In php: $_SERVER['SERVER_NAME'] = '*somedomain.tld' And if try to use smtp transport, error will be fired.

    opened by pudovmaxim 29
  • Having

    Having "Fatal error: Uncaught ReflectionException"

    Hi! Catched this:

    Fatal error: Uncaught ReflectionException: Class Egulias\EmailValidator\EmailValidator does not exist in /.../lib/classes/Swift/DependencyContainer.php:309 Stack trace: #0 /.../lib/classes/Swift/DependencyContainer.php(309): ReflectionClass->__construct('Egulias\EmailVa...') #1 /.../lib/classes/Swift/DependencyContainer.php(323): Swift_DependencyContainer->createNewInstance('email.validator') #2 /.../lib/classes/Swift/DependencyContainer.php(114): Swift_DependencyContainer->createSharedInstance('email.validator') #3 /.../lib/classes/Swift/DependencyContainer.php(371): Swift_DependencyContainer->lookup('email.validator') #4 /.../lib/classes/Swift/DependencyContainer.php(348): Swift_DependencyContainer->lookupRecursive('email.validato in /.../lib/classes/Swift/DependencyContainer.php on line 309

    My code:

    require_once __DIR__.'/lib/swift_required.php';
    
    $transport = new Swift_SmtpTransport('localhost', 25);
    
    $mailer = new Swift_Mailer($transport);
    
    $message = ( new Swift_Message("...!"))
    ->setFrom(['...@...' => '...'])
    ->setTo(['...@...'])
    ->setBody("...")
    ->setContentType('text/html') ;
    

    Php version: 7.0 Swiftmailer: 6.0.2 (downloaded master-version in oficial site) Have no EmailValidator (At least I think so. And I don't know how to check it if I have it. I installed nothing.)

    opened by TimurGumarov 28
  • Add IDN (non-ASCII domain names) support

    Add IDN (non-ASCII domain names) support

    When i use special characters in e-mails which is valid these days you get an error:

    Address in mailbox given [Të[email protected]] does not comply with RFC 2822, 3.6.2.

    Original creation date: 2009-05-22T11:56:20Z Original reporter: Maciej Lisiewski Original ticket: http://swiftmailer.lighthouseapp.com/projects/21527/tickets/93

    opened by swiftmailer 27
  • SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

    SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

    Hello,

    We are using Laravel 4.2 on Laravel Forge servers. We are getting the error above when trying to send through SMTP.

    Our SSL provider has confirmed the cert is successfully installed.

    Our SMTP provider has confirmed all ok on the server front.

    A bit stuck now. Any suggestions would be very helpful.

    opened by paulfry 26
An IMAP library for PHP

Fetch Fetch is a library for reading email and attachments, primarily using the POP and IMAP protocols. Installing N.b. A note on Ubuntu 14.04 (probab

Tedious Developments 500 Dec 25, 2022
PHP library for parsing plain text email content.

EmailReplyParser EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby.

William Durand 606 Dec 8, 2022
Small PHP library to valid email addresses using a number of methods.

Email Validator Small PHP library to valid email addresses using a number of methods. Features Validates email address Checks for example domains (e.g

James Jackson 154 Dec 31, 2022
Bounce Mail Handler for PHP | This is a "reboot" of PHPMailer-BMH from WorxWare.

PHP 7.0+ Support Composer & PSR-0 Support PHPUnit testing via Travis CI (TODO: more tests needed) PHP-Quality testing via SensioLabsInsight (TODO: mor

Lars Moelleken 43 Jan 7, 2023
Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)

PHP IMAP Initially released in December 2012, the PHP IMAP Mailbox is a powerful and open source library to connect to a mailbox by POP3, IMAP and NNT

Sergey 1.5k Jan 3, 2023
IMAP Library for PHP

IMAP Library for PHP Description PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled.

null 157 Jan 7, 2023
Cypht: Lightweight Open Source webmail written in PHP and JavaScript

All your E-mail, from all your accounts, in one place. Cypht is not your father's webmail. Unless you are one of my daughters, in which case it is your father's webmail. Cypht is like a news reader, but for E-mail. Cypht does not replace your existing accounts - it combines them into one. And it's also a news reader.

Jason Munro 773 Dec 30, 2022
Crud PHP 8 com Form E-mail

Crud com PHP 8 PDO Login - Cadastro de Usuários - Edição - Deleção - Adição | Formulário envio de e-mail Para rodar o Crud é preciso instalar um servi

Isaias Oliveira 4 Nov 16, 2021
Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.

Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app. This enables your app to not only respond to new emails but also allows it to read and parse existing mails and much more.

null 530 Jan 6, 2023
📧 Handy email creation and transfer library for PHP with both text and MIME-compliant support.

?? Handy email creation and transfer library for PHP with both text and MIME-compliant support.

Nette Foundation 401 Dec 22, 2022
PHPMailer – A full-featured email creation and transfer class for PHP

PHPMailer – A full-featured email creation and transfer class for PHP Features Probably the world's most popular code for sending email from PHP! Used

PHPMailer 19.1k Jan 2, 2023
EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby

EmailReplyParser EmailReplyParser is a PHP library for parsing plain text email content, based on GitHub's email_reply_parser library written in Ruby.

William Durand 606 Dec 8, 2022
A ready-to-use PHP script for sending Emails with an HTML Template will use a Gmail account as the sender and you will not need any email server. Powered by PHPMailer.

Gmail Email Sender by PHP A ready-to-use PHP script for sending Emails with an HTML Template will use a Gmail account as the sender and you will not n

Max Base 4 Oct 29, 2022
Comprehensive Plugin for composer to execute PHP Quality assurance Tools

NOT MAINTANED ANYMORE The development of composer-plugin-qa was dropped in favor of phpqa which is actively maintained. The project use docker and can

Webysther Nunes 25 Apr 30, 2021
Mailing Microservice - My solution for Moroccan PHPers's February 2022 Challenge

Mailing Microservice Solution for Moroccan PHPers's February 2022 Challenge by Rabyâ Raghib ([email protected]). It mainly consists of: a php app th

Rabyâ Raghib 1 Aug 11, 2022
Mailing platform with templates and logs included.

MailCarrier User-friendly, API-ready mail platform with templates and logs. Design global layouts, compose your template, preview your emails and send

MailCarrier 18 Dec 14, 2022
OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures all the essential functionalities required for any enterprise.

OrangeHRM Open Source Application OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures all the essential functionalities

OrangeHRM 452 Jan 4, 2023
A comprehensive library for generating differences between two strings in multiple formats (unified, side by side HTML etc). Based on the difflib implementation in Python

PHP Diff Class Introduction A comprehensive library for generating differences between two hashable objects (strings or arrays). Generated differences

Chris Boulton 708 Dec 25, 2022
The Phoronix Test Suite is the most comprehensive testing and benchmarking platform

The Phoronix Test Suite is the most comprehensive testing and benchmarking platform available for Linux, Solaris, macOS, Windows, and BSD operating systems.

Phoronix Test Suite 1.9k Jan 7, 2023
DooTask is a lightweight open source online project task management tool that provides various document collaboration tools, online mind mapping, online flowcharting, project management, task distribution, instant IM, file management and other tools.

DooTask is a lightweight open source online project task management tool that provides various document collaboration tools, online mind mapping, online flowcharting, project management, task distribution, instant IM, file management and other tools.

kuaifan 3k Jan 5, 2023