Hello, I was recently instructed to use our internal apprelay server for
sending email internally.
But one of the quirks of the server is that is does not require username or
password.
how do I do I got about doing that because when I comment out in the db.py
and appconf.ini the lines that refer to login I get the following:
web2py™ Version 2.13.3-stable+timestamp.2015.12.24.08.08.22
Python Python 2.7.5: /usr/bin/uwsgi (prefix: /usr)Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
Traceback (most recent call last):
File "/opt/www-data/web2py/gluon/main.py", line 450, in wsgibase
serve_controller(request, response, session)
File "/opt/www-data/web2py/gluon/main.py", line 186, in serve_controller
run_models_in(environment)
File "/opt/www-data/web2py/gluon/compileapp.py", line 576, in run_models_in
restricted(code, environment, layer=model)
File "/opt/www-data/web2py/gluon/restricted.py", line 227, in restricted
exec ccode in environment
File "/opt/www-data/web2py/applications/networktools/models/db.py"
<https://lapspm01094d01.adt.np.costco.com/admin/default/edit/networktools/models/db.py>,
line 89, in <module>
mail.settings.login = myconf.take('smtp.login')
File "/opt/www-data/web2py/gluon/contrib/appconfig.py", line 70, in take
(part, '-->'.join(walking)))
BaseException: login not in config [smtp]
So i figured on the backend its looking for login explicitly.
Anything thought or options.
Otherwise should I just use an external library and doing something like
the following (but I would like to use the baked in tools) :
# email
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.Utils import formatdate
try:
s = smtplib.SMTP('server.com')
except:
print "error connecting to email server"
return -1
try:
s.sendmail(m_from,m_to,msg.as_string())
s.quit()
except:
print "error sendmail email report"
s.quit()
return -1
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.