Skip to main content

Email Setup Guide - IONOS SMTP

Overviewโ€‹

The contact form is configured to use IONOS email hosting with SMTP for sending emails.


โš™๏ธ Configurationโ€‹

IONOS SMTP Settings (Already Configured)โ€‹

SMTP Server: smtp.ionos.co.uk
SMTP Port: 587 (TLS)
Authentication: Required

๐Ÿ”ง Setup Instructionsโ€‹

Step 1: Update Your Environment Fileโ€‹

Edit your env.development file and replace the placeholder values:

# Email Configuration (IONOS SMTP)
EMAIL_ENABLED=true
EMAIL_HOST=smtp.ionos.co.uk
EMAIL_PORT=587
EMAIL_USER=your-actual-email@agentification.co.uk # โ† CHANGE THIS
EMAIL_PASSWORD=your-actual-password # โ† CHANGE THIS
EMAIL_FROM=noreply@agentification.co.uk # โ† Sender address
EMAIL_TO=info@agentification.co.uk # โ† Recipient address

Replace:

  • your-actual-email@agentification.co.uk - Your IONOS email address
  • your-actual-password - Your IONOS email password
  • Update EMAIL_FROM and EMAIL_TO as needed

Step 2: Restart Your Serverโ€‹

After updating the environment file:

# Stop the current server (Ctrl+C)
# Then restart:
python main.py

Step 3: Test the Contact Formโ€‹

  1. Go to: http://localhost:3000/contact
  2. Fill out the form
  3. Submit
  4. Check your terminal for email status
  5. Check your inbox at info@agentification.co.uk

๐Ÿงช Testing Modesโ€‹

Development Mode (EMAIL_ENABLED=false)โ€‹

  • Logs contact submissions to console only
  • No emails sent
  • Returns success message
  • Good for testing without sending real emails
EMAIL_ENABLED=false

Console output:

============================================================
๐Ÿ“ง EMAIL SIMULATION (EMAIL_ENABLED=false)
============================================================
From: John Doe <john@example.com>
Subject: Question about courses
Message:
I'd like to know more about your courses...
============================================================

Production Mode (EMAIL_ENABLED=true)โ€‹

  • Connects to IONOS SMTP server
  • Sends actual emails
  • Logs success/failure to console
EMAIL_ENABLED=true

Console output (success):

๐Ÿ“ง Connecting to smtp.ionos.co.uk:587...
๐Ÿ”’ Starting TLS...
๐Ÿ”‘ Authenticating as noreply@agentification.co.uk...
๐Ÿ“ค Sending email to info@agentification.co.uk...
โœ… Email sent successfully!
From: John Doe <john@example.com>
Subject: Question about courses

๐Ÿ” Troubleshootingโ€‹

Error: "SMTP Authentication failed"โ€‹

Cause: Wrong username or password

Fix:

  1. Double-check your IONOS email credentials
  2. Make sure you're using the full email address as EMAIL_USER
  3. Verify password is correct (no extra spaces)
EMAIL_USER=your-email@agentification.co.uk # Must be full email
EMAIL_PASSWORD=YourCorrectPassword # Check for typos

Error: "Connection timeout"โ€‹

Cause: Firewall or network issue

Fix:

  1. Check if port 587 is open
  2. Try from a different network
  3. Contact IONOS support if persistent

Error: "Email service configuration error"โ€‹

Cause: Missing credentials in environment file

Fix:

  1. Verify EMAIL_USER is set
  2. Verify EMAIL_PASSWORD is set
  3. Restart server after updating

Emails not arrivingโ€‹

Check:

  1. โœ… Is EMAIL_ENABLED=true?
  2. โœ… Did you restart the server?
  3. โœ… Check spam folder
  4. โœ… Verify EMAIL_TO address is correct
  5. โœ… Check terminal for "โœ… Email sent successfully!"

๐Ÿ“ง Email Formatโ€‹

Email Subject:โ€‹

Contact Form: [User's Subject]

Email Body:โ€‹

New contact form submission from Agentification website:

Name: John Doe
Email: john@example.com
Subject: Question about courses

Message:
I'd like to know more about your courses...

---
This email was sent from the Agentification contact form.
Reply to: john@example.com

๐Ÿ” Security Notesโ€‹

  1. Never commit real passwords to git
  2. Keep env.development and env.production in .gitignore
  3. Use environment variables in production (Vercel/deployment platform)
  4. Consider using app-specific passwords if available

๐Ÿš€ Production Deploymentโ€‹

For Vercel/Production:โ€‹

  1. Copy env.production.example to env.production
  2. Update with real credentials
  3. Or set in Vercel dashboard:
    • Go to Project Settings
    • Environment Variables
    • Add each EMAIL_* variable

Vercel Environment Variables:

EMAIL_ENABLED=true
EMAIL_HOST=smtp.ionos.co.uk
EMAIL_PORT=587
EMAIL_USER=your-email@agentification.co.uk
EMAIL_PASSWORD=your-password
EMAIL_FROM=noreply@agentification.co.uk
EMAIL_TO=info@agentification.co.uk

โœ… Checklistโ€‹

Before going live:

  • IONOS email credentials added to environment file
  • EMAIL_ENABLED=true set
  • Server restarted
  • Test email sent successfully
  • Received test email in inbox
  • Production environment variables configured
  • Contact form tested on live site

๐Ÿ“ž Supportโ€‹

IONOS Support:

  • If you have issues with SMTP authentication
  • Check your IONOS control panel for SMTP settings
  • Verify your email account is active

Code Issues:

  • Check terminal for error messages
  • Look for "โŒ" error indicators
  • Review the detailed error output

๐ŸŽฏ Quick Startโ€‹

Minimum required changes:

  1. Open env.development
  2. Change these two lines:
    EMAIL_USER=your-actual-email@agentification.co.uk
    EMAIL_PASSWORD=your-actual-password
  3. Restart server: python main.py
  4. Test: Visit /contact and submit form
  5. Check terminal and your email inbox

That's it! ๐ŸŽ‰


Last Updated: October 2025