-
Notifications
You must be signed in to change notification settings - Fork 53
Cypress Mailer Setup Instructions
These instructions are for Cypress v3 which is not the latest version of Cypress. In Cypress v4, you can configure email settings by navigating to Admin > Application Settings > Edit Application Settings .
-
Set up your email account.
- Any email account with an SMTP server will work (Gmail, Outlook, etc.).
- We'll use Gmail for this tutorial.
- If you're using a Gmail account, it works best with 2 Factor Authentication turned on; this helps the mailer work with some Gmail security settings.
-
Open
<app_directory>/config/cypress.yml
on the server in your favorite text editor.- This file will allow you to set the mailer settings; setting mailer settings through the web admin pane is currently not supported (settings changes will not be persisted to disk)
-
In the
website_domain
andwebsite_port
fields, replace<%= ENV["WEBSITE_DOMAIN"] %>
with the URL of your Cypress instance (hostname or IP address), and<%= ENV["WEBSITE_PORT"] %>
with the port the webserver is running on (usually80
). -
In the
mailer_address
field, replace<%= ENV["MAILER_ADDRESS"] %>
with the URL of your SMTP server.- In Gmail, the
mailer_address
issmtp.gmail.com
- In Gmail, the
-
In the
mailer_port
field, replace<%= ENV["MAILER_PORT"] %>
with the port for the SMTP server.- If you're using Gmail, this will be
587
, the port for TLS/STARTTLS access to the SMTP server. - Use of TLS/STARTTLS is recommended for security reasons.
- If you're using Gmail, this will be
-
In the
mailer_domain
field, replace<%= ENV["MAILER_DOMAIN"] %>
with the email address domain.- For example,
[email protected]
'smailer_domain
value would begmail.com
- For example,
-
In the
mailer_user_name
andmailer_password
field,s replace<%= ENV["MAILER_USER_NAME"] %>
with the username for the email account, and<%= ENV["MAILER_PASSWORD"] %>
with the email account password.- For
[email protected]
, the username would befoo
- If you're using Gmail with 2 Factor Authentication, the password should be an "App Password". If you're not using 2 Factor Authentication, be sure to enable access by less secure apps
- For
-
Save
cypress.yml
. -
Restart the Cypress server.