PHP code example of arrogance / mailrelay-bundle

1. Go to this page and download the library: Download arrogance/mailrelay-bundle 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/ */

    

arrogance / mailrelay-bundle example snippets


    $bundles = array(
        // ...
        new Arrogance\MailrelayBundle\ArroganceMailrelayBundle(),
    );

use Arrogance\MailrelayBundle\Email;
// ...
$client = $this->get('arrogance_mailrelay.client');

$email = new Email\Email();
$email->addEmail('[email protected]', 'Your recipìent')
    ->addEmail('[email protected]')
    ->setSubject('Email de prueba desde la API')
    ->setHtml($this->get('twig')->render('@YourBundle/Default/email.html.twig', array()))
    ->setFromId(1)
    ->setReplyId(1)
    ->setReportId(1)
    ->setPackageId(6);

// Mailrelay response
$response = $client->sendMail($email);