0

I am using an exchange server, and I am able to download the inbox with the below code:

$hostname = "$server/pop3/ssl/novalidate-cert}INBOX";
$inbox = imap_open($hostname,$username,$password) or die('ERROR: ' . 
imap_last_error());

However, when I try to download the sent folder, I have no luck.

I have tried:

$hostname = "{$server/pop3/ssl/novalidate-cert}Sent";
$hostname = "{$server/imap/ssl/novalidate-cert}Sent";
$hostname = "{$server/imap/ssl/novalidate-cert}Sent Messages";

As well as various other names for the "Sent folder." What am I missing?

If I use imap I get the below error: ERROR: [CLOSED] IMAP connection broken (server response)

1 Answers1

0

This worked for me

$path = "{outlook.office365.com:993/imap/ssl/novalidate-cert/authuser=". $mail->Username ."/user=".$mail->Username."}Sent";
    $imapStream = imap_open($path, $mail->Username, 'Password');