PHP code example of decomplexity / sendoauth2

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

    

decomplexity / sendoauth2 example snippets


new SendOauth2A ($mailStatus,[
'mailTo' => ['[email protected]'],
'mailSubject' => 'Deer dear!',
'mailText'=>'Lovely photo you sent. Tnx',
'mailAuthSet' => '1'
]);

namespace decomplexity\SendOauth2; 

SendOauth2A has two arguments:
$mailStatus
$options - an array of the options described below

So instantiation looks something like:

new SendOauth2A ($mailStatus,$options)

It is preceded by:

namespace decomplexity\SendOauth2;
"Sending failed. Error message: " . $mailStatus); 
}


namespace decomplexity\SendOauth2;
session_start();
[email protected]'],
'mailSubject' => 'Deer dear!',
'mailText'=>'Lovely photo you sent. Tnx',
'mailAuthSet' => '1'
]);
$_SESSION = array();

if ($mailStatus == "OK") {
echo ("Email sent OK");
}
else
{
echo ("Sending failed. Error message: " . $mailStatus); 
}

namespace decomplexity\SendOauth2;
session_start();
[email protected], John Doe', '[email protected],Jaime Cordobes'],
'mailCC' => ['[email protected], Jane Doe', '[email protected]'],
'mailBCC' => ['[email protected], Jack the Lad'], 
'mailFrom' => ['[email protected], Hugo Plantagenet'],
'mailReplyTo' =>['[email protected], Lucinda Leveson-Gower'],
'mailSubject' => 'Windsor Castle',
'mailText'=>'Re my knighthood - see <img src="cid:cholmondeley-pic"> for our coat of arms. A letter also attached',
'mailAttach' =>['letter.jpg'],
'mailAttachInline' =>['coatofarms.jpg, cholmondeley-pic'],
'mailAuthSet' => '1'
]);

$_SESSION = array();

if ($mailStatus == "OK") {
echo ("Email sent OK");
}
else
{
echo ("Sending failed. Error message: ". $mailStatus); 
}

        if (!empty($options['refresh_token'])) {
            $this->refreshToken = $options['refresh_token'];