Cypress Mailer Setup Instructions - projectcypress/cypress GitHub Wiki
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 .
Mailer setup instructions:
-
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.ymlon 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_domainandwebsite_portfields, 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_addressfield, replace<%= ENV["MAILER_ADDRESS"] %>with the URL of your SMTP server.- In Gmail, the
mailer_addressissmtp.gmail.com
- In Gmail, the
-
In the
mailer_portfield, 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_domainfield, replace<%= ENV["MAILER_DOMAIN"] %>with the email address domain.- For example,
[email protected]'smailer_domainvalue would begmail.com
- For example,
-
In the
mailer_user_nameandmailer_passwordfield,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.