Mail sending module for Mezzio and Laminas MVC with support for file attachment and template email composition

Overview

AcMailer

Build Status Code Coverage Latest Stable Version Total Downloads License Paypal Donate

This module provides an easy and flexible way to send emails from Mezzio and Laminas MVC applications (formerly known as Zend Expressive and Zend MVC). It allows you to pre-configure emails and transports, and then send those emails at runtime.

You will be able to compose emails from templates, and easily add attachments using different strategies.

Installation

The recommended way to install this module is by using composer.

composer require acelaya/acmailer

If this gives you any problem, try using the old package name.

composer require acelaya/zf2-acmailer

Documentation

You can browse the online documentation here https://acmailer.github.io/acmailer.


Thanks to JetBrains for their support to open source projects.

PhpStorm

Comments
  • Pass params to layout

    Pass params to layout

    Hi,

    As far as I searched there is no way to pass variables/params to layout.

    By example the Email title should be included into layout. For this we need a way to pass it to layout.

    question 
    opened by cbichis 19
  • duplicate headers

    duplicate headers

    problem with amazon ses : Transaction failed: Duplicate header 'Content-Transfer-Encoding'. it happens when send at least 2 mails conf: 'mail_options' => [ 'mail_adapter' => 'smtp', 'from' => '[email protected]', "from_name" => "xxxxx", 'server' => 'email-smtp.eu-west-1.amazonaws.com', 'smtp_user' => 'xxxxxxxx', 'smtp_password' => 'xxxxxxxxxx', 'ssl' => 'tls', 'port' => 587, ]

    the call: $mailService = $this->getMailService(); $mailService->setSubject('test); $mailService->setTemplate('my/template/path'); $mailService->getMessage()->addTo('[email protected]'); $mailService->send();

    Zend\Mail\Headers with two headersKeys contenttransferencoding, contentype

    bug 
    opened by jbhuguenin 15
  • Use MailViewRenderer instead of viewrenderer

    Use MailViewRenderer instead of viewrenderer

    Could you change service viewrenderer to the alias to this service (ie. MailViewRenderer):

    in config\module.config.php add to aliases:

            'aliases' => array(
                'mailservice' => 'AcMailer\Service\MailService',
                'mailviewrenderer' => 'viewrenderer'
            )
    

    and in src\Service\Factory\MailServiceFactory.php::createRenderer:

            if ($sm->has('mailviewrenderer')) {
                return $sm->get('mailviewrenderer');
            };
    

    Why? Now I can't easily override this, so I can't use for example Twig.

    Thanks in advance.

    enhancement 
    opened by kusmierz 15
  • Fix layout not receiving template params when using zend/renderer with zend-mvc

    Fix layout not receiving template params when using zend/renderer with zend-mvc

    Settings are in mail.global.php and I have stored the template file in my view folder under email/contact.phtml. The following code results in a "can't resolve to file" error:

    return [
      'acmailer_options' => [
    
        /*
        * This is where you configure all the emails that can be sent by the application.
        * You can create new ones at runtime, but this eases predefining emails that do not need to 
          change
        */
        'emails' => [
          'contact' => [
            'template' => 'application/email/contact',
    

    I have also tried just using the layout param in the 'template_params' array when calling the send method, but without specifying a template it is ignored. Is it possible to specify the template when calling the send method?

    bug question 
    opened by miv23 13
  • The extends property is mapped when its value is null, making the MailOptions to throw an exception

    The extends property is mapped when its value is null, making the MailOptions to throw an exception

    Hi, version 5.0.1, I get an error An abstract factory could not create an instance of acmailer.mailservice.default(alias: AcMailer\Service\MailService)

    bug 
    opened by academici 11
  • Unable to render template

    Unable to render template

    I'm getting the following error

    Zend\View\Renderer\PhpRenderer::render: Unable to render template "ModuleName/view/mail/template"; resolver could not resolve to a file
    
    Zend\View\Renderer\PhpRenderer::render: Unable to render template "./module/ModuleName/view/mail/template"; resolver could not resolve to a file
    

    Already tried using the full path to file. I'm getting the same error.

    Any ideas?

    Thank you in advance.

    question 
    opened by x-fran 10
  • subject bug in thunderbird

    subject bug in thunderbird

    Heyho, at first great project!

    The Second thing is, could it be, that there is a bug in the set Subject Method?

    example source:

     $oEmail = $this->getEmail();
                    $oEmail->getMessage()->setTo($user->getEmail());
                    $oEmail->getMessage()->setSubject("Neues Kennwort - Tauch-buddy.de");
                    $oEmail->setTemplate('email/forgotPasswordConfirm', [
                        'oUser' => $user,
                        'password' => $password,
                    ]);
                    $acMailerResult =  $oEmail->send();
                    $result = $acMailerResult->isValid();
    

    Result in email on Subject:

    Neues Kennwort - Tauch-buddy.de, Neues Kennwort - Tauch-buddy.de charset="utf-8"
    

    Result is missmatching the setten value of setSubject.

    opened by N3XT0R 10
  • Service not available trough cron

    Service not available trough cron

    Hi. Trying to access your service trough command line gives me this exception:

    Zend\ServiceManager\Exception\ServiceNotFoundException An alias "mailviewrenderer" was requested but no service could be found.

    More data available if needed. Probably due to misconception about CLI or misconfiguration in the controller. Accesing it by browser works ok.

    bug 
    opened by digitlou 10
  • False is unsupported SSL type

    False is unsupported SSL type

    I have two mail config in my app (mail.local.php, mail.global.php). mail.global.php is config with real SMTP settings and supported SSL (ssl => 'tls'). mail.local.php is dev config with fake SMTP setting (mailcatcher).

    When I set up ssl => false in mail.local.php then app throw an exception is unsupported SSL type. But I see comment in config:

    /*
     * This defines the encryption type to be used, 'ssl' or 'tls'.
     * Boolean false should be used to disable SSL.
     *
     * Default value is false
     */
    

    What am I doing wrong?

    bug 
    opened by marinovdf 9
  • Make sure any error while sending an email is handled by throwing an exception

    Make sure any error while sending an email is handled by throwing an exception

    For historical reasons, the send method returns a mail result, which has a isValid method telling you if the email was properly sent.

    However, it can also throw an exception, which introduces two paths to handle errors while calling send.

    try {
        $result = $mailService->send(...);
        if (! $result->isValid()) {
            // Email was not properly sent
        }
    } catch (MailException $e) {
        // Email was also not properly sent
    }
    

    In order to simplify this, let's change the internal logic to make sure any error is always thrown as an exception (in fact, it's probable that this is already the case).

    Let's also mark the isValid method as deprecated, and remove any reference from the documentation.

    opened by acelaya 8
  • After updating to ZF 2.4.2 module throws the exception on try to get service from servicemanager.

    After updating to ZF 2.4.2 module throws the exception on try to get service from servicemanager.

    After updating to ZF 2.4.2 module throws the exception on try to get service from servicemanager.

    $mailService = $this->getServiceLocator()->get('AcMailer\Service\MailService');

    Uncaught exception 'Zend\Mail\Exception\InvalidArgumentException' with message 'Email must be a valid email address'

    The issue is related to parameter "from' => ''" in config file. New version of zend framework not allow to pass empty From header on module init. If i uncomment this parameter and fill it with something all works fine, but i don't need this default parameter because i set "from" header in runtime.

    bug 
    opened by syberon 8
  • Decommissioning AcMailer

    Decommissioning AcMailer

    This package has become less and less relevant, and there are probably better alternatives.

    It depends on a mailing library (laminas-mail) which is not so well maintained. If I had to choose a mailing library today, I would probably select another option.

    Also, looking at download stats, you can see all come from very old and unmaintained versions, so it's not dragging attention anymore.

    Because of that, and considering solving some of those problems would require some time I don't currently have, I have decided to decommission this module, and stop maintaining it.

    I'll keep this issue pinned for a while, and then archive the repository.

    opened by acelaya 0
Releases(v8.2.0)
A mail driver to quickly preview mail

A mail driver to quickly preview mail This package can display a small overlay whenever a mail is sent. The overlay contains a link to the mail that w

Spatie 1k Jan 4, 2023
A Laravel package to check if you can send e-mail through a given mailserver in name of a given e-mail address

A Laravel package to check if you can send e-mail through a given mailserver in name of a given e-mail address Mail spf checker A Laravel package to c

Dieter Coopman 110 Dec 16, 2022
Provides a clean and simple way to configure the WordPress-bundled PHPMailer library, allowing you to quickly get started sending mail through a local or cloud based service of your choice

WP PHPMailer provides a clean and simple way to configure the WordPress-bundled PHPMailer library, allowing you to quickly get started sending mail through a local or cloud based service of your choice.

Itineris Limited 61 Dec 6, 2022
Simple mail sending by PHPMailer and Create your local system.

Simple mail sending by PHPMailer and Create your local system. Send mail zero of cost and also send Attachment like Photo, pdf and multiple files. You should be create a login and verify two steps authentication like OTP, verifications ?? link. PHPMailer make your dreams project eassy and simple also free of cost.

SUSHIL KUMBHAR 2 Dec 8, 2021
Magento 2 Email Catcher or Email Logger Module.

Magento 2 Module Experius email catcher / - logger

Experius 49 Dec 16, 2021
This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified.

Laravel Verify New Email Laravel supports verifying email addresses out of the box. This package adds support for verifying new email addresses. When

Protone Media 300 Dec 30, 2022
The classic email sending library 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 19k Jan 1, 2023
Sending Email via Microsoft Exchange Web Services made Easy!

Send Mail via Exchange Web Services! Sending Email via Microsoft Exchange Web Services (EWS) made easy! Installation Install via Composer composer req

Raju Rayhan 19 Jul 19, 2022
SendPortal - Open-source self-hosted email marketing, subscriber and list management, email campaigns and more

SendPortal includes subscriber and list management, email campaigns, message tracking, reports and multiple workspaces/domains in a modern, flexible and scalable application.

Mettle 1.2k Jan 4, 2023
Cross-language email validation. Backed by a database of over 38 000 throwable email domains.

Cross-language temporary (disposable/throwaway) email detection library. Covers 38038+ fake email providers.

Francois-Guillaume Ribreau 1.4k Jan 9, 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
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
:envelope: E-Mail Address Validator (syntax, dns, trash, typo)

✉️ E-Mail Address Validator for PHP Warning The best way to validate an e-mail address is still to send a duplicate opt-in-mail, when the user clicks

Lars Moelleken 41 Dec 25, 2022
Laravel Mail Credentials switcher for Budget Laravel Applications

Laravel Mail Switcher Laravel Mail Credentials Switcher is a library which helps you to: Manage your Mail Service Credentials Configure the Laravel's

(Seth) Phat Tran 34 Dec 24, 2022
PostfixAdmin - web based virtual user administration interface for Postfix mail servers

PostfixAdmin An open source, web based interface for managing domains/mailboxes/aliases etc on a Postfix based mail server.

PostfixAdmin 755 Jan 3, 2023
Laravel Mail Catcher Driver

Laravel Mail Catcher Driver This package include a new mailbase driver which will catch all the sent emails and save it to the database. It then expos

Tauqeer Liaqat 94 Aug 30, 2022
💌 Mail app for Nextcloud

Nextcloud Mail ?? A mail app for Nextcloud Why is this so awesome? ?? Integration with other Nextcloud apps! Currently Contacts, Calendar & Files – mo

Nextcloud 684 Dec 26, 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
Mail Web is a Laravel package which catches emails locally for debugging

Mail Web is a Laravel package which catches emails locally for debugging Installation Use the package manager composer to install Mail Web. composer r

Appoly 64 Dec 24, 2022