Hotel Guevarini uses PHPMailer to send transactional emails. SMTP credentials are configured directly inside each PHP file that sends mail — there is no centralized config file for email.
Files That Require SMTP Configuration
You must update the credentials in all four of the following files. Each one handles a different email flow, and a missing or incorrect credential in any single file will break that specific flow.
| File | Email Sent |
|---|
php/auth/procesar_registro.php | Account verification email sent after public self-registration |
php/auth/enviar_recuperacion.php | Password recovery link emailed to the user |
php/auth/reenviar_verificacion.php | Re-sends the verification link to an unverified account |
php/usuarios/guardar_usuario.php | Verification email sent when an administrator creates a user |
You must update the SMTP credentials in all 4 files. Updating only some of them will leave certain email flows broken — for example, password recovery may work while admin-created user verification does not.
SMTP Configuration Block
Each of the four files contains a block like the following. The fields marked REEMPLAZAR (“replace”) must be filled in with your actual SMTP credentials:
$mail->isSMTP();
$mail->Host = 'sandbox.smtp.mailtrap.io'; // O tu servidor SMTP
$mail->SMTPAuth = true;
$mail->Username = 'TU_USUARIO_SMTP'; // REEMPLAZAR
$mail->Password = 'TU_PASSWORD_SMTP'; // REEMPLAZAR
$mail->SMTPSecure = 'tls';
$mail->Port = 2525;
Setting Descriptions
| Setting | Description |
|---|
Host | The hostname of your SMTP server (e.g. sandbox.smtp.mailtrap.io or smtp.gmail.com). |
SMTPAuth | Set to true to authenticate with the SMTP server using the credentials below. |
Username | Your SMTP account username or API key, provided by your email service. |
Password | Your SMTP account password or API secret. |
SMTPSecure | Encryption method. 'tls' is used here, which works with STARTTLS on port 2525 or 587. |
Port | The port your SMTP server listens on. Mailtrap sandbox uses 2525; most production providers use 587 (TLS) or 465 (SSL). |
Example Configurations
Mailtrap (Testing)
Production SMTP
Mailtrap’s sandbox captures all outgoing emails into a virtual inbox without delivering them to real addresses. This makes it ideal for local and staging environments.$mail->Host = 'sandbox.smtp.mailtrap.io';
$mail->SMTPAuth = true;
$mail->Username = 'your_mailtrap_username'; // from Mailtrap inbox credentials
$mail->Password = 'your_mailtrap_password'; // from Mailtrap inbox credentials
$mail->SMTPSecure = 'tls';
$mail->Port = 2525;
To get your credentials: log in to Mailtrap, open your inbox, go to SMTP Settings, and copy the username and password shown there.Mailtrap is recommended for local and staging environments. It lets you test the full email flow — including clickable verification and recovery links — without risking mail delivery to real users or getting flagged as spam.
For a live deployment, replace the Mailtrap settings with the credentials from your transactional email provider (e.g. SendGrid, Mailgun, Amazon SES, or your hosting provider’s SMTP relay).$mail->Host = 'smtp.your-provider.com';
$mail->SMTPAuth = true;
$mail->Username = 'your_smtp_username';
$mail->Password = 'your_smtp_password';
$mail->SMTPSecure = 'tls';
$mail->Port = 587; // or 465 for SSL
Check your provider’s documentation for the exact host, port, and encryption settings they require.
Where to Find the Block in Each File
The SMTP configuration appears inside a try block within the section of each file that handles email sending. Search for $mail->isSMTP() in any of the four files to jump directly to the configuration block.
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = '...'; // <-- edit here
$mail->Username = '...'; // <-- edit here
$mail->Password = '...'; // <-- edit here
$mail->Port = ...; // <-- edit here
// ...
$mail->send();
} catch (Exception $e) {
// error handling
}