Jordan I located your shell user and took a look at your script.
The problem is that it's been saved with DOS-style line endings which are breaking the shebang in the first line of the script, eg:
$ echo foo | ./mailscript_example.py
-bash: ./mailscript_example.py: /home/jordan/apps/xxxx/env/bin/python^M: bad interpreter: No such file or directory
The ^M
in there is the clue.
To fix this, convert the file to UNIX-style line endings with dos2unix
:
dos2unix mailscript_example.py