Skip to main content

Email Setup

Configure email delivery so your Event Schedule instance can send ticket confirmations, newsletters, follower notifications, and more.

Overview

Event Schedule uses email for several features. Without a working email configuration, these features will not function:

Ticket Confirmations

Automatic emails sent to buyers after purchasing tickets, including ticket details and QR codes.

Newsletters

Send newsletters to followers of your schedules with upcoming event announcements.

Follower Notifications

Automatic notifications sent to followers when new events are published on a schedule.

Account Emails

Password resets, email verification, and other account-related emails.

Important

By default, Event Schedule uses the log mail driver which writes emails to your log file instead of sending them. You must configure a real mail driver before going to production.

SMTP Setup

SMTP is the most common way to send email. You can use any SMTP provider such as your hosting provider's mail server, Gmail, Outlook, or a transactional email service.

Environment Variables

Add these to your .env file:

.env
MAIL_MAILER=smtp
MAIL_HOST=smtp.example.com
MAIL_PORT=587
MAIL_USERNAME=[email protected]
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="${APP_NAME}"

Variable Reference

Variable Description Example
MAIL_MAILER Mail driver to use smtp
MAIL_HOST SMTP server hostname smtp.gmail.com
MAIL_PORT SMTP port number 587 (TLS) or 465 (SSL)
MAIL_USERNAME SMTP authentication username Your email address or API username
MAIL_PASSWORD SMTP authentication password Your password or app-specific password
MAIL_ENCRYPTION Encryption protocol tls or ssl
MAIL_FROM_ADDRESS Default sender email address [email protected]
MAIL_FROM_NAME Default sender name ${APP_NAME} (uses your app name)

Popular SMTP Providers

Here are the settings for commonly used SMTP services:

Gmail / Google Workspace

Host: smtp.gmail.com | Port: 587 | Encryption: tls

Requires an App Password if 2FA is enabled.

Outlook / Microsoft 365

Host: smtp.office365.com | Port: 587 | Encryption: tls

Amazon SES

Host: email-smtp.us-east-1.amazonaws.com (region-specific) | Port: 587 | Encryption: tls

Use your SES SMTP credentials (not your AWS access keys).

Mailgun

Host: smtp.mailgun.org | Port: 587 | Encryption: tls

Username is usually [email protected].

Other Mail Drivers

While SMTP works with any email provider, Laravel also supports dedicated drivers for certain services. These drivers use the provider's API directly, which can be faster and more reliable than SMTP.

Driver MAIL_MAILER Value Notes
SMTP smtp Works with any SMTP server (recommended for most users)
Mailgun mailgun Requires MAILGUN_DOMAIN and MAILGUN_SECRET
Amazon SES ses Requires AWS credentials configured
Postmark postmark Requires POSTMARK_TOKEN
Sendmail sendmail Uses the server's local sendmail binary
Log log Writes emails to log file (default, for development only)
Recommendation

For production selfhosted instances, we recommend using SMTP with a transactional email service like Mailgun, Amazon SES, or Postmark. These services are designed for application-generated emails and offer better deliverability than personal email accounts.

Sender Configuration

The MAIL_FROM_ADDRESS and MAIL_FROM_NAME determine who emails appear to come from.

.env
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="My Event Schedule"
DNS Records

To improve email deliverability and avoid spam filters, set up these DNS records for your sending domain:

  • SPF - Authorizes your mail server to send on behalf of your domain
  • DKIM - Adds a digital signature to verify email authenticity
  • DMARC - Tells receiving servers how to handle authentication failures

Your email provider will give you the specific DNS records to add. Check their documentation for setup instructions.

Testing

After configuring your email settings, verify that emails are being sent correctly.

Quick Test

Use Laravel's built-in Artisan command to send a test email:

bash
php artisan tinker --execute="Mail::raw('Test email from Event Schedule', function(\$m) { \$m->to('[email protected]')->subject('Test'); });"

If the email arrives, your configuration is working. If not, check the troubleshooting section below.

Clear Config Cache

After changing .env values, clear the config cache:

bash
php artisan config:clear

Troubleshooting

Emails not sending

  • Check storage/logs/laravel.log for error messages
  • Verify MAIL_MAILER is not set to log (the default)
  • Run php artisan config:clear after changing .env
  • Make sure the queue worker is running if emails are queued: php artisan queue:work

Connection refused or timeout

  • Verify your server's firewall allows outbound connections on port 587 (or 465)
  • Some hosting providers block outbound SMTP. Check with your host.
  • Try using port 465 with MAIL_ENCRYPTION=ssl if port 587 is blocked

Authentication errors

  • Double-check your MAIL_USERNAME and MAIL_PASSWORD
  • For Gmail, use an App Password instead of your regular password
  • Make sure special characters in your password are properly quoted in the .env file (wrap in double quotes)

Emails going to spam

  • Set up SPF, DKIM, and DMARC DNS records for your domain
  • Use a MAIL_FROM_ADDRESS on a domain you own (not a free email provider)
  • Consider using a dedicated transactional email service (Mailgun, SES, Postmark)