PHP code example of codeminds / mailmanager

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

    

codeminds / mailmanager example snippets


use TYPO3\CMS\Extbase\Annotation\Inject;

/**
 * @Inject
 * @var Codeminds\MailManager\Service\MailService
 */
protected $mailService = null;

.
.
.

$variables = array('variable' => 'world');
$this->mailService->sendMail('MyIdentifier', $variables);

    templatePathAndFileName: 'EXT:form/Resources/Private/Frontend/Templates/Finishers/Email/Html.html'
    partialRootPaths: ['EXT:form/Resources/Private/Frontend/Partials']

$pathAttachments[] = 'EXT:your_site_package/Resources/Private/Pds/attachment.pdf';
$file = $myFileReference->getOriginalResource();
$swiftAttachments[] = Swift_Attachment::newInstance($file->getContents(), $file->getName(), $file->getMimeType());
$this->mailService->sendMail('MyIdentifier', $variables, $pathAttachments, $swiftAttachments);