One of the tasks in the software testing process is testing and debugging email functionality. Having a good and reliable tool for this purpose is essential, and that’s where DebugMail comes to the rescue.
DebugMail is a virtual mail server that allows you to test applications and websites without the need to install an SMTP server. To start using it, all you need to do is change the host, port, username and password settings in your mail configuration to match the values provided by the DebugMail service.
More details of the integration steps are described below.
Preparing the project for integration with DebugMail
Step 1. Install the virtual environment of the project:
python -m venv venv
Step 2. Activate the virtual environment:
command for Windows
venv\Scripts\activate
Step 3. After setting up the virtual environment, let’s proceed with installing Django:
pip install Django
Step 4. Let’s create a project:
django-admin startproject mysite
Step 5. Create the templates directory in the root of mysite.
Step 6. Create the main.html file (for now, without any inheritance, just for displaying mail submission).
Step 7. Write the main template for mail submission:
Step 15. After that, go to http://127.0.0.1:8000/. And test it out!
Step 16. Check the results.
Finally, we have done all the steps. And now is the time to check the results. If you check your DebugMail project, you have received the email successfully as below.
In conclusion
I hope this guide has helped you successfully integrate DebugMail into your project, making it easier to test functionality related to sending email. If you have any questions or need help with integration, just email us. We are always ready to help!