PHP code example of syntaxerro / mail-api-sdk

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

    

syntaxerro / mail-api-sdk example snippets



// or use composer for auto-loading

/* Login using email address and password. */
$server = new \SyntaxErro\SyntaxServer("[email protected]", "smtp-api-sdk");

/* Create new message to [email protected] with content. */
$message = new \SyntaxErro\SmtpBundle\SyntaxEmail("Hello. I'm testing your API.", "[email protected]");

/* Set subject of message */
$message->setSubject("It's a test message!");

/* Set reply-to header. */
$message->setReplyTo("[email protected]");

/* Set my full name displayed instead of emails address. */
$message->setAs("Darth Vader");

/* Send message. */
$server->send($message);

$message = new \SyntaxErro\SmtpBundle\SyntaxEmail("Hello. I'm testing your API.", ["[email protected]", "[email protected]"]);

$message = new \SyntaxErro\SmtpBundle\SyntaxEmail("Hello. I'm testing your API.");
$message
    ->addRecipient("[email protected]")
    ->addRecipient("[email protected]");

phpunit --bootstrap=vendor/autoload.php tests/