gosmtpimapmta

How to upload copy of sent with smtp email


I use go-mail library to send emails with smtp. But I faced common issue that sent emails won't appear in sent folder. Googling I found that the only way to solve it is to upload sent email though imap.

The question is how do I obtain copy of sent email with smtp email?


Solution

  • We've implemented the following approach and it works for us:

    1. Send email with smtp and bcc to own email.
    2. Move/upload email with imap to sent folder.
    3. For polling new messages use UID which is auto increment, so just remember the last processed and download all that is more than that.