WebFaction
Community site: login faq

Hi,

I was able to send the email in my website code like

from django.core.mail import send_mail
send_mail(
    'Subject here',
    'Here is the message.',
    'mailbox_name@domain.tld',
    ['recepient@domain.tld'],
    fail_silently=False,
)

I received the email on my side and everithing is fine. But I dont see the email in Sent folder in the webfaction webmail

asked 09 Dec '16, 21:24

Romeno
134
accept rate: 0%


When you send a message via webmail, or via any other IMAP mail client, two things are happening:

  • The message is sent to the recipient via SMTP.
  • The message is copied to your Sent folder via IMAP.

Django's send_mail only sends the message over SMTP - it doesn't have any IMAP capabilities, so it can't perform the task of storing the message in your Sent folder.

If you need a copy of the messages sent by Django, then you could BCC the messages to whatever address you have targeting your mailbox, and then perhaps use a procmail rule to move the messages to your Sent folder, eg:

:0:
* ^From:.*mailbox_name@domain\.tld
.Sent/

Note that if you want to set a BCC recipient, then you'll need to work directly with the EmailMessage class since send_mail doesn't support BCC. If you're not able to do that, then instead you could just call send_email twice - once to the recipient, and once to yourself.

Hope that helps!

permanent link

answered 10 Dec '16, 00:56

seanf
12.2k42136
accept rate: 37%

Thanks for the comprehensive answer!

(10 Dec '16, 11:37) Romeno
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×263
×24

question asked: 09 Dec '16, 21:24

question was seen: 2,135 times

last updated: 10 Dec '16, 11:37

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM