Fix EHLO domain for Versio Exim anti-spoofing and upgrade test email to formatted HTML

This commit is contained in:
2026-11-02 11:39:56 +01:00
parent ab1d46e0e3
commit 72c0feb1f3
2 changed files with 27 additions and 3 deletions
@@ -166,12 +166,29 @@ class ContentController extends Controller
$recipient = $validated['test_email'];
$defaultMailer = config('mail.default');
$fromAddress = config('mail.from.address');
$fromName = config('mail.from.name', 'Jouwdriedee.nl');
$smtpHost = config('mail.mailers.smtp.host');
$smtpPort = config('mail.mailers.smtp.port');
try {
Mail::raw("Dit is een test e-mail vanaf Jouwdriedee.nl om de e-mail bezorging naar {$recipient} te controleren.\n\nActieve mailer: {$defaultMailer}\nSMTP Server: {$smtpHost}:{$smtpPort}\nAfzender: {$fromAddress}\nDatum: ".now()->format('d-m-Y H:i:s'), function ($message) use ($recipient) {
Mail::html('
<div style="font-family: -apple-system, BlinkMacSystemFont, \'Segoe UI\', Roboto, sans-serif; max-width: 600px; margin: 0 auto; padding: 24px; background: #ffffff; border-radius: 12px; border: 1px solid #e2e8f0;">
<div style="margin-bottom: 20px;">
<h2 style="margin: 0; color: #0f172a; font-size: 20px;">Test E-mail • Jouwdriedee.nl</h2>
<p style="color: #64748b; font-size: 13px; margin: 4px 0 0 0;">Deze e-mail bevestigt dat de e-mailverbinding succesvol tot stand is gebracht.</p>
</div>
<div style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; font-size: 13px; color: #334155; line-height: 1.6;">
<p style="margin: 0 0 8px 0;"><strong>Ontvanger:</strong> '.e($recipient).'</p>
<p style="margin: 0 0 8px 0;"><strong>Verzendende Driver:</strong> '.e($defaultMailer).'</p>
<p style="margin: 0 0 8px 0;"><strong>SMTP Server:</strong> '.e($smtpHost).':'.e($smtpPort).'</p>
<p style="margin: 0 0 8px 0;"><strong>Afzender:</strong> '.e($fromName).' &lt;'.e($fromAddress).'&gt;</p>
<p style="margin: 0;"><strong>Tijdstip:</strong> '.now()->format('d-m-Y H:i:s').'</p>
</div>
<p style="color: #94a3b8; font-size: 12px; margin-top: 20px;">Jouwdriedee.nl • 3D Printstudio & Webshop</p>
</div>
', function ($message) use ($recipient, $fromAddress, $fromName) {
$message->to($recipient)
->from($fromAddress, $fromName)
->subject('Test E-mail vanaf Jouwdriedee.nl');
});
@@ -181,7 +198,7 @@ class ContentController extends Controller
}
return redirect()->route('admin.content.index', ['tab' => 'email'])
->with('success', "Test e-mail succesvol overhandigd aan de SMTP-server ({$smtpHost}:{$smtpPort}) voor {$recipient}! Controleer je inbox en eventueel je spamfolder.");
->with('success', "Test e-mail succesvol overhandigd aan de SMTP-server ({$smtpHost}:{$smtpPort}) voor {$recipient}! Controleer zowel je inbox als je Spam/Ongewenst map.");
} catch (\Throwable $e) {
Log::error('Test mail error: '.$e->getMessage(), ['trace' => $e->getTraceAsString()]);