Problems with send mail. Ad created Letters do not have Hosting PythonAnywhere
## configure email mail = auth.settings.mailer mail.settings.server = 'logging' or 'smtp.gmail.com:587' mail.settings.sender = '[email protected]' mail.settings.login = '[email protected]:secretcode' def created_ad(): category = get_category() db.ad_post.public_ad.readable = False db.ad_post.public_ad.writable = False db.ad_post.visit.readable = False db.ad_post.visit.writable = False db.ad_post.category.default = category.id db.ad_post.subcategory.requires = IS_IN_DB(db(db.subcategory.category == category.id), 'subcategory.id', '%(name)s') from gluon.utils import web2py_uuid db.ad_post.uuid.default = uuid = web2py_uuid() if auth.user: address = db.address(created_by=auth.user.id) user = auth.user form = SQLFORM.factory(db.ad_post, formstyle='divs') if form.process().accepted: id = db.ad_post.insert(**db.ad_post._filter_fields(form.vars)) db.contact.insert(index_contact=address.index_contact, country=address.country, region=address.region, city=address.city, address=address.address, telephone=address.telephone, email=address.email, ad_post=id, name_contact=auth.user.first_name + " " + auth.user.last_name) session.flash = T('Thank you, ad completed and sent for review') redirect(URL('list_all_ads_by_datetime')) mail.send(to=[form.vars.email], bcc=['[email protected]'], subject='Объявление создано в категории %(title)s' % form.vars, message='<html><body>' + form.vars.title + '<br/>' + form.vars.body + '<br/>' + str( form.vars.price) + '</body></html>', encoding='utf-8') else: form = SQLFORM.factory(db.ad_post, db.contact, formstyle='divs', ) if form.process().accepted: id = db.ad_post.insert(**db.ad_post._filter_fields(form.vars)) form.vars.ad_post = id id = db.contact.insert(**db.contact._filter_fields(form.vars)) session.flash = T('Thank you, ad completed and sent for review') redirect(URL('list_all_ads_by_datetime')) mail.send(to=[form.vars.email], bcc=['[email protected]'], subject='Объявление создано в категории %(title)s' % form.vars, message='<html><body>' + form.vars.title + '<br/>' + form.vars.body + '<br/>' + str( form.vars.price) + '</body></html>', encoding='utf-8') response.title = T('Создать новое объявление в категорию "%(name)s"') % dict(name=category.name) response.description = T('Создать новое объявление в категорию %(name)s') % dict(name=category.name) response.meta.keywords = T('Создать новое объявление в категорию %(name)s') % dict(name=category.name) return locals() -- 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.

