15👍
✅
There are in fact standardized headers to specify response headers: http://cr.yp.to/immhf/response.html.
As far as implementing this in Django is concerned, the documentation contains an example:
from django.core.mail import EmailMessage
email = EmailMessage(
'Hello', # email subject
'Body goes here', # email body
'from@example.com', # sender address
['to1@example.com', 'to2@example.com'],
['bcc@example.com'],
headers={'Reply-To': 'another@example.com'},
)
This solved my problem.
4👍
- Allow a task execution if it's not already scheduled using celery
- Django querysets + memcached: best practices
- Uploading Large files to AWS S3 Bucket with Django on Heroku without 30s request timeout
2👍
The RFC says you can specify multiple emails and that is what I was looking for. Came up with this:
from django.core.mail import EmailMessage
headers = {'Reply-To': 'email@one.com;email@two.com'}
msg = EmailMessage(subject, html_content, EMAIL_HOST_USER, email_list, headers=headers)
msg.content_subtype = "html"
msg.send()
Works like a charm. Note: EMAIL_HOST_USER is imported from your settings file as per Django doc email setup. More on this here, search for ‘reply-to’: https://docs.djangoproject.com/en/dev/topics/email/
- Django Rest queryset filter by url parameter
- (gcloud.app.deploy) Error Response: [7] Access Not Configured. Cloud Build has not been used in project
0👍
Here is also how reply-to can be used
from django.core.mail import EmailMessage
email = EmailMessage(
'Hello',
'Body goes here',
'from@example.com',
['to1@example.com', 'to2@example.com'],
['bcc@example.com'],
reply_to=['another@example.com'],
headers={'Message-ID': 'foo'},
)
Read more at docs docs.djangoproject
Source:stackexchange.com