$username = "";
$password = "";

$html = '<p>Hello world!</p>';

$data = [
'SendEmails' => [
[
'EmailDataArray' => [
[
'email' => [
// Message fields...
[
"to_email" => "",
"to_name" => "",
"from_email" => "",
"from_name" => "",
"message_subject" => "",
"message_html" => $html,
]
]
]
]
]
]
];

$request_data = json_encode($data);
$content_type = "application/json";

$url = 'https://e1.envoke.com/api/v4legacy/send/SendEmails';

$curl = curl_init();

curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
curl_setopt($curl, CURLOPT_USERPWD, $username . ':' . $password);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request_data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, [ 'Content-Type: ' . $content_type . '; charset=utf-8' ]);
curl_setopt($curl, CURLOPT_URL, $url);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

Did this answer your question?