You need to add the credentials for your email (username and password) like this:
mail_handler = SMTPHandler(mailhost=('smtpout.secureserver.net',25),
fromaddr='info@mydomain.com',
toaddrs=ADMINS, subject='YourApplication Failed',
credentials=('mail_username','mail_password'))
In essence you need to login into your mail account (from godaddy) to be able to send emails. The IP used needs to be the IP provided by godaddy for the STMP service (I believe it is smtpout.secureserver.net) and the port without SSL is one of 25, 80, 3535 if you are using SSL the port is 465.
Hope it helps!
EDIT:
Since it still doesn't work when it should I'm adding a full minimal source code to test it, this is the quickstart minimal hello word example modified to send emails when an error occurs and to always fail (it will send an email every time you access the page), fully tested on godaddy (us):
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
raise Exception
#return 'Hello World!'
if __name__ == '__main__':
ADMINS = ['admin@mydomain.com']
if not app.debug:
import logging
from logging.handlers import SMTPHandler
mail_handler = SMTPHandler(mailhost=('smtpout.secureserver.net',25),
fromaddr='admin@mydomain.com',
toaddrs=ADMINS, subject='YourApplication Failed',
credentials=('admin@mydomain.com','mypassword'))
mail_handler.setLevel(logging.ERROR)
app.logger.addHandler(mail_handler)
app.run()
It is important tho that you need to check the actual smtp server you need to use. When you log into godaddy click the email admin button (the button on email workspace) there go to the top menu TOOLS -> SERVER FUNCTIONS . After that select your domain and in the last row (SMTP) you should see a domain like the one I provided for the smtp outgoing access, in my case I have different ones for different domains:
smtpout.asia.secureserver.net
smtpout.secureserver.net
Find the one you need to use and modify my sample code, you should receive the emails instantly on the web interface of your godaddy email.
Once you have the right server and use your credentials you should receive an email like this one when running the app:
Exception on / [GET]
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\flask\app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "C:\Python27\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Python27\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Python27\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Python27\lib\site-packages\flask\app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "hello.py", line 6, in hello_world
raise Exception
Exception