1
目前我有一个在Django中使用亚马逊SES发送电子邮件的工作实现。如何通过Django中的Amazon SES发送电子邮件时更改显示名称?
我的设置看起来像这样。在settings.py我:
EMAIL_HOST = 'email-smtp....'
EMAIL_PORT = 25
EMAIL_HOST_USER = 'my-email-host-user'
EMAIL_HOST_PASSWORD = 'my-email-host-password'
EMAIL_USE_TLS = True
在我看来,我有:
from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
from django.contrib import messages
from django.core.mail import send_mail
from django.core.mail import EmailMessage
def index(request):
email_message = EmailMessage('This is a title', 'This is a message body', '[email protected]', ['[email protected]'])
email_message.send()
return HttpResponse("You just sent an email message.")
当我打开邮件,我得到这个在标题:
[email protected] via amazonses.com
我想定制这个,以便我可以这样做:
UserFirstName UserLastName via amazonses.com
我该如何去做这件事?
这是正是我所期待的。我的意思是不要在我的示例中省略<[email protected]>。谢谢! – 2015-02-06 18:14:03