1. Go to this page and download the library: Download ravisystems/ravimail-php 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/ */
ravisystems / ravimail-php example snippets
use Ravimail\Client;
$rm = new Client('rvm_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
// Send a transactional email
$resp = $rm->transactional->send([
'to' => '[email protected]',
'from' => '[email protected]',
'subject' => 'Welcome to the show',
'html' => '<h1>Glad you’re here</h1>',
]);
echo $resp['data']['message_id']; // msg_xxxxxxxxxxxx
$test = new Client('rvm_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
$test->transactional->send([/* ... */]); // returns msg_sandbox_xxx, doesn't bill