PHP code example of shippinno / email

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

    

shippinno / email example snippets


use Shippinno\Email\SwiftMailer\SwiftMailerSendEmail;
use Tanigami\ValueObjects\Web\Email;
use Swift_Mailer;

$sendEmail = new SwiftMailerSendEmail(new Swift_Mailer(...));
$sendEmail->execute(
    new Email(...),
    3 // max reattempts
);

use function Shippinno\Email\SwiftMailer\register_swift_non_rfc_email_validator;

allow_non_rfc_email_address();
(new Swift_Message)->setTo('[email protected]'); // => OK

new EmailAddress('[email protected]') // => InvalidArgumentException
new EmailAddress('[email protected]', true); // => OK