fix video
This commit is contained in:
@@ -86,6 +86,65 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
|
||||
}
|
||||
}
|
||||
|
||||
// Processa test invio email
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['test_email'])) {
|
||||
$test_email = sanitize_input($_POST['test_email_address'] ?? '');
|
||||
|
||||
if (empty($test_email) || !validate_email($test_email)) {
|
||||
$error = 'Inserisci un indirizzo email valido';
|
||||
} else {
|
||||
$subject = "Test Email - " . SITE_NAME;
|
||||
$body = "
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; }
|
||||
.container { max-width: 600px; margin: 0 auto; padding: 20px; }
|
||||
.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 20px; text-align: center; border-radius: 8px 8px 0 0; }
|
||||
.content { background: #f9f9f9; padding: 30px; border-radius: 0 0 8px 8px; }
|
||||
.success { color: #2ECC71; font-size: 24px; font-weight: bold; }
|
||||
.info { background: #e8f4f8; padding: 15px; border-left: 4px solid #3498db; margin: 15px 0; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='container'>
|
||||
<div class='header'>
|
||||
<h1>✅ Test Email Configurazione SMTP</h1>
|
||||
</div>
|
||||
<div class='content'>
|
||||
<p class='success'>Congratulazioni!</p>
|
||||
<p>La configurazione SMTP funziona correttamente.</p>
|
||||
<p>Hai ricevuto questa email di test da <strong>" . SITE_NAME . "</strong></p>
|
||||
<div class='info'>
|
||||
<strong>Dettagli configurazione:</strong><br>
|
||||
Host: " . SMTP_HOST . "<br>
|
||||
Port: " . SMTP_PORT . "<br>
|
||||
Username: " . SMTP_USERNAME . "<br>
|
||||
Encryption: " . SMTP_ENCRYPTION . "
|
||||
</div>
|
||||
<p>Ora il sistema è pronto per inviare email agli utenti per:</p>
|
||||
<ul>
|
||||
<li>Benvenuto alla registrazione</li>
|
||||
<li>Reset password</li>
|
||||
<li>Conferma acquisti</li>
|
||||
<li>Notifiche importanti</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
";
|
||||
|
||||
if (send_email($test_email, $subject, $body)) {
|
||||
set_flash_message('success', '✅ Email di test inviata con successo a ' . htmlspecialchars($test_email) . '! Controlla la casella di posta.');
|
||||
header('Location: profile.php');
|
||||
exit;
|
||||
} else {
|
||||
$error = '❌ Errore durante l\'invio dell\'email. Verifica le impostazioni SMTP in config.php';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="it">
|
||||
@@ -241,6 +300,36 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Test Invio Email -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>📧 Test Invio Email</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p style="margin-bottom: 1rem; color: #666;">
|
||||
Verifica che la configurazione SMTP funzioni correttamente inviando una email di test.
|
||||
</p>
|
||||
<form method="POST" class="form">
|
||||
<div class="form-group">
|
||||
<label for="test_email_address">Indirizzo Email per Test</label>
|
||||
<input
|
||||
type="email"
|
||||
id="test_email_address"
|
||||
name="test_email_address"
|
||||
value="<?php echo htmlspecialchars($user['email']); ?>"
|
||||
placeholder="tua-email@esempio.com"
|
||||
required
|
||||
>
|
||||
<small class="form-text">Riceverai una email di test a questo indirizzo</small>
|
||||
</div>
|
||||
|
||||
<button type="submit" name="test_email" class="btn btn-secondary">
|
||||
📨 Invia Email di Test
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Informazioni Account -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
|
||||
Reference in New Issue
Block a user