1. Go to this page and download the library: Download dibmartins/locaweb 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/ */
dibmartins / locaweb example snippets
try{
= new \Locaweb\Api('https://api.smtplw.com.br/v1/', 'your_auth_token');
$message = new \Locaweb\Message($api);
$response = $message->post([
'headers' => ['Content-Type': 'text/plain'], // 'text/html' para body em html
'subject' => "qualquer titulo",
'body' => "qualquer corpo",
'from' => "[email protected]",
'to' => "[email protected]",
'cc' => ['[email protected]', '[email protected]'],
'bcc' => ['[email protected]', '[email protected]']
]);
var_dump($response);
}
catch(\Locaweb\Exception $e){
var_dump($e);
}