I am trying to use python's imaplib to create an email and send it to a mailbox with specific name, e.g. INBOX. Anyone has some great suggestion :).
+3
A:
The IMAP protocol is not designed to send emails. It is designed to manipulate mailboxes.
To create an email and send it you can use SMTP, as in smtplib.
To move an email that is already in a mailbox from one folder to another, you can copy the mail to the needed folder and delete it from the old one using uid
, as in the answer here.
Muhammad Alkarouri
2010-09-22 13:44:22
thk:), but can i create email in specific mailbox using imaplib?
vernomcrp
2010-09-22 16:17:36
@vernomcrp: No, because as I explained imaplib cannot be used to create emails. You can send the email first then move it as above.
Muhammad Alkarouri
2010-09-22 16:31:06
A:
No idea how they do it but doesn't Microsoft Outlook let you move an email from a local folder to a remote IMAP folder?
Ben Scherrey
2010-09-24 12:51:25