PHP code example of awsm / lib-mail

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

    

awsm / lib-mail example snippets




use AWSM\LibMail\Transporter\PhpMail;
use AWSM\LibMail\Mail;
use AWSM\LibMail\MailException;


$mail = new Mail();
$transporter = new PhpMail();

try {
    $mail->addToEmail( '[email protected]' );
    $mail->setFromName( 'Developer' );
    $mail->setFromEmail( '[email protected]' );
    $mail->setSubject( 'Read my mail!' );
    $mail->setContent( 'Hello John! Greetings from the developer!' );

    $transporter->setMail( $mail );
    $transporter->send();
} catch ( MailException $e ) {
    echo $e->getMessage();
}