PHP code example of dwolke / zf-mailer

1. Go to this page and download the library: Download dwolke/zf-mailer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dwolke / zf-mailer example snippets




return array(
  'modules' => array(
    // ...
    'ZfMailer',
    // ...
  ),
  // ...
);


// get the service
$mailer = $serviceManager->get('ZfMailer\Service\Mailer');

// create a new mail
$mailer->createNewMail($recipient, $subject, $sender);

// set the content and render the e-mail body
$mailer->prepareAsMultipart($mailContent, $textTemplate, $htmlTemplate);

// send the e-mail
$mailer->sendEmail();