PHP code example of mouf / utils.mailer.db-mail-service

1. Go to this page and download the library: Download mouf/utils.mailer.db-mail-service 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/ */

    

mouf / utils.mailer.db-mail-service example snippets


$mailService = Mouf::getDBMailService();

$mail = new Mail();
$mail->setBodyText("This is my mail!");
$mail->setBodyHtml("This is my &lt;b&gt;mail&lt;/b&gt;!");
$mail->setFrom(new MailAddress("[email protected]", "Server"));
$mail->addToRecipient(new MailAddress("[email protected]", "David"));
$mail->setTitle("My mail");

$mailService->send($mail);

$mailService = Mouf::getDBMailService();

$mail = new DBMail();
$mail->setBodyText("This is my mail!");
$mail->setBodyHtml("This is my &lt;b&gt;mail&lt;/b&gt;!");
$mail->setFrom(new MailAddress("[email protected]", "Server"));
$mail->addToRecipient(new MailAddress("[email protected]", "David"));
$mail->setTitle("My mail");

// Let's set the category
$mail->setCategory("My category");

// Let's set the type
$mail->setType("My type");

$mailService->send($mail);