How to send email notifications from Abaqus

In some cases, we may have to wait several hours or even days for a simulation to be completed or to post-process hundreds of analysis. So, from time to time we have to go to the computer to check whether it has already finished or not. This “check” is trivial in many cases: go to your PC, take a look and that’s it.

However, in many other cases it is a bit more annoyingconnect to a server/cluster, open a remote desktop, interrupt whatever you are doing at that moment, etc…

I had some bad experiences with this issue, and I have recently found a very practical workaround: Abaqus can send emails to notify whatever you wish! For instance, Abaqus can send an email notification when a simulation is completed!

1. Setting up a Google account (Gmail)

In the video-tutorial below, I explain how to send emails from Abaqus using a Google account. It is the easiest mail server that I have found to send emails from Abaqus. Follow this steps to set it up:

  1. Create a Google account.
  2. Go to the Google account settings and in the “Security” tab, enable “Less secure app access”. Recently, this has changed and now you will have to set up an “App password” and use it, instead of your regular password.

Since this is a more vulnerable account, I recommend you to create a completely new Google account only to send these emails.

2. Sending email notifications from Abaqus

The keypoint to send emails from Abaqus is using a Python script in which we make use of a library to send these emails. The Python library responsible for this is smtplib. Then, we only have to open a port to the Gmail server and login with the credentials of our new Google account (username and password).
In the following video you will see a detailed description of how to:
  • Setup the Google account.
  • Create a Python script to send notifications by email from Abaqus.
  • Put everything together: pre-processing, solution, post-processing and email notification using a simple finite element model in the same workflow.
You can download all the scripts here and don’t forget to put them in the work directory of Abaqus (as shown in the video).

If you have any question or you come up with more ideas to take advantage of sending email notifications from Abaqus, leave it in the comments section below!

And if you want to know more about Abaqus Scripting with Python take a look at this post and learn how to create your own scripts from scratch.

I hope that you find this tip useful!

Leave a Comment

Scroll to Top