PHP code example of audi2014 / smtp-mailer

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

    

audi2014 / smtp-mailer example snippets




use Audi2014\SmtpMailer\SmtpMailer;
$to = "______@_________";
$emailString = "emailString";
$subject = "subject";
$mailer = new SmtpMailer([
    SmtpMailer::CONFIG_FROM => "____________@_________",
    SmtpMailer::CONFIG_HOST => "smtp._________.___",
    SmtpMailer::CONFIG_PORT => 587,
    SmtpMailer::CONFIG_SECURE => "___",
    SmtpMailer::CONFIG_LOGIN => "____________@_________",
    SmtpMailer::CONFIG_PASSWORD => "_______________",
    SmtpMailer::CONFIG_LOGGER => 'html',
]);
echo $mailer->mailToUsers([$to], $emailString, $subject, $_FILES) ? 'ok' : 'error';