1. Go to this page and download the library: Download eustasy/browning 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/ */
eustasy / browning example snippets
return [
// Mailgun API URL
// Replace `<`example.com`>` with your verified Mailgun domain.
'URL' => 'https://api.mailgun.net/v3/example.com',
// Mailgun private API key.
// Get it from "Domain Settings" > "Sending Keys" in your Mailgun dashboard.
'Key' => '<your-mailgun-api-key>',
'Default' => [
'Regards' => 'Example Support', // Sender display name
'ReplyTo' => '[email protected]', // From / reply-to address
],
// Optional reCAPTCHA v2 keys (see section 3).
'Recaptcha' => [
'SiteKey' => '<your-recaptcha-site-key>',
'SecretKey' => '<your-recaptcha-secret-key>',
],
];
use Eustasy\Browning\Mailer;
$config = esult = $mailer->send(
'[email protected]', // Required: recipient address
'Message Subject', // Required: subject line
'Text or HTML body', // Required: message body
'Sender Name', // Optional: overrides Default.Regards
'[email protected]', // Optional: overrides Default.ReplyTo
);
if ($result->success) {
echo 'Email sent successfully.';
} else {
echo 'Failed to send email: ' . $result->error;
}