我一直覺得Django電子郵件的行爲像電子郵件客戶端,這就是爲什麼您必須指定EMAIL_HOST,EMAIL_HOST_PASSWORD和EMAIL_HOST_USER。 Django應用程序的行爲就像一個普通的電子郵件客戶端,就像Outlook或蘋果郵件一樣......Django電子郵件客戶端
我測試的應用程序必須每隔一段時間發送一次電子郵件。但是當我在我的應用程序執行以下語句:
subject, from_email, to = 'hello', '[email protected]', '[email protected]'
text_content = 'This is an important message.'
html_content = '<p>This is an <strong>important</strong> message.</p>'
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.send()
我越來越...
Traceback (most recent call last):
File "<console>", line 1, in <module>
.
.
SMTPRecipientsRefused: {'[email protected]': (504, '5.5.2 <wmsdesktop>: Helo command rejected: need fully-qualified hostname')}
其中wmsdesktop是我的開發系統的名稱。從這個錯誤我得到的印象是,Django應用程序的行爲就像一個smtp服務器。
或者我在這裏錯過了一些東西。請在這裏說明一些...
聽起來像您在設置中有錯誤。 – Brandon 2013-03-15 00:51:30
請發佈您的設置代碼。我想這是因爲你的電子郵件設置 – princess 2013-03-15 05:35:24