@@ -0,0 +1,1994 @@
+%0A#%0A# spyne - Copyright (C) Spyne contributors.%0A#%0A# This library is free software; you can redistribute it and/or%0A# modify it under the terms of the GNU Lesser General Public%0A# License as published by the Free Software Foundation; either%0A# version 2.1 of the License, or (at your option) any later version.%0A#%0A# This library is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A# Lesser General Public License for more details.%0A#%0A# You should have received a copy of the GNU Lesser General Public%0A# License along with this library; if not, write to the Free Software%0A# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301%0A#%0A%0Afrom __future__ import absolute_import%0A%0Aimport logging%0Alogger = logging.getLogger(__name__)%0A%0Aimport getpass%0Aimport inspect%0Aimport traceback%0Aimport smtplib%0A%0Afrom socket import gethostname%0Afrom email.Utils import formatdate%0Afrom email.mime.text import MIMEText%0A%0A%0Adef email_exception(exception_address, message=%22%22):%0A    # http://stackoverflow.com/questions/1095601/find-module-name-of-the-originating-exception-in-python%0A    frm = inspect.trace()%5B-1%5D%0A    mod = inspect.getmodule(frm%5B0%5D)%0A    module_name = mod.__name__ if mod else frm%5B1%5D%0A%0A    sender = 'error@software.arskom.com.tr'%0A    receivers = %5B'herkes@software.arskom.com.tr'%5D%0A%0A    error_str = (%22%25s%5Cn%5Cn%25s%22 %25 (message, traceback.format_exc()))%0A    msg = MIMEText(error_str.encode('utf8'), 'plain', 'utf8')%0A    msg%5B'To'%5D = exception_address%0A    msg%5B'From'%5D = 'Spyne %3Crobot@spyne.io%3E'%0A    msg%5B'Date'%5D = formatdate()%0A    msg%5B'Subject'%5D = %22(%25s@%25s) %25s%22 %25 (getpass.getuser(), gethostname(), module_name)%0A%0A    try:%0A        smtp_object = smtplib.SMTP('localhost')%0A        smtp_object.sendmail(sender, receivers, msg.as_string())%0A        logger.error(%22Error email sent%22)%0A%0A    except Exception, e:%0A        logger.error(%22Error: unable to send email%22)%0A        logger.exception(e)%0A

add the util.email module that the project template uses.