1. Go to this page and download the library: Download orboto/mail 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/ */
$result = $mail->send([
'from' => '[email protected]',
'to' => '[email protected]',
'replyTo' => 'Customer Support <[email protected]>', // replies land here, not at noreply@
'subject' => 'Your order shipped',
'text' => 'Reply to this mail if anything is off.',
]);
$summary = $mail->dmarc->summary('acme.example.com', '30d'); // '7d' | '30d' | '90d'
if ($summary['summary'] === null) {
// nothing received yet - reports take 24-48h to start arriving
}
$rate = $summary['summary']['authPassRate']; // 0..1
$ips = $mail->dmarc->sourceIps('acme.example.com'); // who sends as you, and whether they align
$page = $mail->dmarc->reports('acme.example.com', ['limit' => 20]);
$one = $mail->dmarc->report($page['reports'][0]['id']); // envelope + per-IP records
$mail->dmarc->setAlerts('acme.example.com', ['notifyEmail' => '[email protected]']);
// -> `dmarc.anomaly` webhook event + a plain-text mail when the pass rate drops >10 pp week over week,
// a new IP sends >100 messages in a day, or rejects jump to >5x the 30-day median
$mail->dmarc->alerts('acme.example.com'); // ['enabled' => true, 'notifyEmail' => ..., ...]
$mail->dmarc->disableAlerts('acme.example.com');