Search code examples
emailimapphpmaileroffice365

Store sent mails using PHPMailer into Office365 account


I've started using PHPMailer with an Office365 account and by now it works fine sending emails through SMTP. Anyway I need to store the sent emails, so I've tried @DavidRockin's code but I'm unable to make it store sent emails into the 'Sent items' folder (only the inbox works). Any help?


Solution

  • You need to check if the sent folder exist and the correct name, it can have a similar meaning but different spelling. First, use php_imap to get a list of folders, the one used for storing sent emails can be used with imap_append method