PHP code example of mepost / mepost-sdk
1. Go to this page and download the library: Download mepost/mepost-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/ */
mepost / mepost-sdk example snippets
epost\Client\MepostClient;
use Mepost\Config\MepostConfig;
// Initialize the Mepost client
$apiKey = 'your_api_key_here';
$config = new MepostConfig($apiKey);
$client = new MepostClient($config);
// Send an email
$emailData = [
'from_email' => '[email protected]',
'from_name' => 'Example Company',
'html' => 'This is a test email sent from the Mepost PHP SDK.',
'subject' => 'Example Subject',
'to' => [
['email' => '[email protected]'],
['email' => '[email protected]']
]
];
$response = $client->sendEmail($emailData);
print_r($response);