From dea1b874b55b7d9072d20c89883f53ad179dd9af Mon Sep 17 00:00:00 2001 From: salvacybersec Date: Mon, 10 Nov 2025 19:31:42 +0300 Subject: [PATCH] feat: Send actual test email instead of just verifying connection - testConnection now sends a real test email to the configured Gmail address - User receives actual email confirmation that setup works - Email contains success message and system info --- backend/src/services/mail.service.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/backend/src/services/mail.service.js b/backend/src/services/mail.service.js index 6114ab2..530649b 100644 --- a/backend/src/services/mail.service.js +++ b/backend/src/services/mail.service.js @@ -85,7 +85,18 @@ class MailService { async testConnection() { try { await this.initializeTransporter(); - return { success: true, message: 'Gmail connection successful' }; + + // Send actual test email + const testEmail = await this.sendMail( + this.transporter.options.auth.user, // Send to self + 'Test Mail - Oltalama Paneli', + '

✅ Test Başarılı!

Gmail ayarlarınız doğru yapılandırılmış ve mail gönderimi çalışıyor.

Sistem: Oltalama Test Yönetim Paneli

' + ); + + return { + success: true, + message: `Test maili başarıyla gönderildi! (${testEmail.messageId})` + }; } catch (error) { return { success: false, error: error.message }; }