PHP code example of webprofil / wp-mailqueue

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

    

webprofil / wp-mailqueue example snippets


$mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Mail\MailMessage::class);
$mail
   ->from(new \Symfony\Component\Mime\Address('[email protected]', 'John Doe'))
   ->to(
      new \Symfony\Component\Mime\Address('[email protected]', 'Max Mustermann'),
      new \Symfony\Component\Mime\Address('[email protected]')
   )
   ->subject('Your subject')
   ->text('Here is the message itself')
   ->send()
 ;

$mail = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\WEBprofil\WpMailqueue\Domain\Model\Mail::class);
$mail->setSender(new Address($this->settings['fromMail'], $this->settings['fromName']));
$mail->setRecipient(new Address($recipient));
$mail->setSubject(LocalizationUtility::translate('mail_subject', 'my_extkey', null, $language));
$mail->setBody($html);
$mail->addAttachement($fileObject->getCombinedIdentifier());
MailqueueUtility::addToMailqueue($mail);