django-email

Django Error Reporting - How to know which user triggered the error?

…衆ロ難τιáo~ 提交于 2019-12-04 03:02:04
Is there a way I can customize Django error reporting so when it emails me it lets me know which user triggered the error? I'm in Django 1.2 if it matters. Much Thanks in advance! If you don't want to use sentry you can use this simple middleware to attache the user-infos to the error mail: # source: https://gist.github.com/646372 class ExceptionUserInfoMiddleware(object): """ Adds user details to request context on receiving an exception, so that they show up in the error emails. Add to settings.MIDDLEWARE_CLASSES and keep it outermost(i.e. on top if possible). This allows it to catch

How can I log all outgoing email in Django?

不羁岁月 提交于 2019-12-04 00:48:25
My Django application sends out quite a bit of emails and I've tried testing it thoroughly. However, for the first few months, I'd like to log all outgoing emails to ensure that everything is working smoothly. Is there a Django module that allows me to do this and makes the outgoing emails visible through the administration panel Thanks. I wrote a custom email backend which logs the stuff to a model. Here's my backend: from django.core.mail.backends.smtp import * from django.db import transaction from modules.common.models import * class LoggingEmailBackend(EmailBackend): """ A wrapper around

Attaching an ical file to a django email

北战南征 提交于 2019-12-03 16:48:05
There are plenty of examples of how to attach a file to an email, but I can't find an example of how to attach a MIMEBase instance. From the docs: attachments "These can be either email.MIMEBase.MIMEBase instances, or (filename, content, mimetype) triples." So I'm generating an iCal file in a function just fine: def ical() cal = vobject.iCalendar() cal.add('method').value = 'PUBLISH' # IE/Outlook needs this vevent = cal.add('vevent') vevent.add('dtstart').value = self.course.startdate vevent.add('dtend').value = self.course.startdate vevent.add('summary').value='get details template here or

django to send AND receive email?

让人想犯罪 __ 提交于 2019-12-03 02:01:37
问题 I have gotten quite familiar with django's email sending abilities, but I havn't seen anything about it receiving and processing emails from users. Is this functionality available? A few google searches have not turned up very promising results. Though I did find this: Receive and send emails in python Am I going to have to roll my own? if so, I'll be posting that app faster than you can say... whatever you say. thanks, Jim update : I'm not trying to make an email server, I just need to add

Python/Django: sending emails in the background

最后都变了- 提交于 2019-12-02 23:08:08
Imagine a situation in which a user performs an action on a website and admins are notified. Imagine there are 20 admins to notify. By using normal methods for sending emails with Django the user will have to wait until all the emails are sent before being able to proceed. How can I send all the emails in a separate process so the user doesn't have to wait? Is it possible? Use celery as a task queue and django-celery-email which is an Django e-mail backend that dispatches e-mail sending to a celery task. Another option is django-mailer. It queues up mail in a database table and then you use a

django to send AND receive email?

拜拜、爱过 提交于 2019-12-02 15:38:14
I have gotten quite familiar with django's email sending abilities, but I havn't seen anything about it receiving and processing emails from users. Is this functionality available? A few google searches have not turned up very promising results. Though I did find this: Receive and send emails in python Am I going to have to roll my own? if so, I'll be posting that app faster than you can say... whatever you say. thanks, Jim update : I'm not trying to make an email server, I just need to add some functionality where you can email an image to the site and have it pop up in your account. There's

STARTTLS extension not supported by server - Getting this error when trying to send an email through Django and a private email address

孤街醉人 提交于 2019-12-01 03:59:47
I registered a domain and a private email using namecheap.com. I am trying to send an email from this private email. However, I get the error in the title. In my settings.py, I have these settings: EMAIL_HOST = 'mail.privateemail.com' EMAIL_HOST_USER = 'contact@mysite.com' EMAIL_HOST_PASSWORD = 'my password' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' DEFAULT_FROM_EMAIL = EMAIL_HOST_USER And I am trying to send the email through a view: send_mail( 'Subject here', 'Here is the message.', 'contact@mysite.com', ['myname@gmail.com'], fail

Django send_mail not working

早过忘川 提交于 2019-11-29 07:47:10
问题 When the view that sends the email is used nothing happens, i then entered send_mail(...) into the python shell and it returned 1 but i didn't receive any emails. This is my settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'workorbit@gmail.com' EMAIL_HOST_PASSWORD = 'P@ssw0rd5' EMAIL_USE_TLS = True This is the view: def send_email(request): send_mail('Request Callback', 'Here is the message.', 'workorbit

Creating email templates with Django

雨燕双飞 提交于 2019-11-26 16:50:57
I want to send HTML-emails, using Django templates like this: <html> <body> hello <strong>{{username}}</strong> your account activated. <img src="mysite.com/logo.gif" /> </body> I can't find anything about send_mail , and django-mailer only sends HTML templates, without dynamic data. How do I use Django's template engine to generate e-mails? Dominic Rodger From the docs , to send HTML e-mail you want to use alternative content-types, like this: from django.core.mail import EmailMultiAlternatives subject, from_email, to = 'hello', 'from@example.com', 'to@example.com' text_content = 'This is an

Creating email templates with Django

不羁的心 提交于 2019-11-26 04:02:43
问题 I want to send HTML-emails, using Django templates like this: <html> <body> hello <strong>{{username}}</strong> your account activated. <img src=\"mysite.com/logo.gif\" /> </body> I can\'t find anything about send_mail , and django-mailer only sends HTML templates, without dynamic data. How do I use Django\'s template engine to generate e-mails? 回答1: From the docs, to send HTML e-mail you want to use alternative content-types, like this: from django.core.mail import EmailMultiAlternatives