# Send Mail When an Error Occurs

**URL:** https://forum.itascainternational.com/t/send-mail-when-an-error-occurs/752
**Category:** FLAC3D
**Created:** [September 22, 2022, 10:24pm UTC](https://forum.itascainternational.com/t/send-mail-when-an-error-occurs/752 "2022-09-22T22:24:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CrissBidermann](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@CrissBidermann](https://forum.itascainternational.com/u/CrissBidermann)
#### Post date: [September 22, 2022, 10:24pm UTC](https://forum.itascainternational.com/t/send-mail-when-an-error-occurs/752/1 "2022-09-22T22:24:42Z")

</div>

I have a fish function created that allows me to send a mail when the numerical model is completely resolved. How can I make this fish function execute and send me a mail when an error occurs in the resolution of the model?

---

<div class="post-metadata">

### Author: ![Gian](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@Gian](https://forum.itascainternational.com/u/Gian)
#### Post date: [September 23, 2022, 7:10am UTC](https://forum.itascainternational.com/t/send-mail-when-an-error-occurs/752/2 "2022-09-23T07:10:55Z")

</div>

You can call it using python and try-except statement

---

<div class="post-metadata">

### Author: ![cheng](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@cheng](https://forum.itascainternational.com/u/cheng)
#### Post date: [September 29, 2022, 1:39am UTC](https://forum.itascainternational.com/t/send-mail-when-an-error-occurs/752/3 "2022-09-29T01:39:56Z")

</div>

Something like this (as Gian said) in a .py file:

> try:  
> [space]it.command(“cycle 100”)  
> except:  
> [space]# do something, e.g., send email, when there is a problem
