title: Unable to move mails to sent folder of IMAP using Laravel
body: <p>I am sending emails from my laravel website using SMTP. When i send email to the user then i want to copy that mail to IMAP sent folder too.
  Here is my code when i am sending mail to user: </p>
  
  <pre><code>        $mail = Mail::to($this-&gt;receiver)
              -&gt;send(new ComplaintMail($this-&gt;sender-&gt;user_email,$this-&gt;subject,$this-&gt;complaint,$this-&gt;answers,$this-&gt;sender));
  
          $path = "{mypath.com:993/imap/ssl}Sent";
          $imapStream = imap_open($path,$this-&gt;sender-&gt;user_email,$this-&gt;sender-&gt;email_password);
          $result = imap_append($imapStream,$path,$mail-&gt;getSentMIMEMessage());
          imap_close($imapStream);
  </code></pre>
  
  <p>Also I tried using imap_mail_move() method like so:</p>
  
  <pre><code>        $mail = Mail::to($this-&gt;receiver)
              -&gt;send(new ComplaintMail($this-&gt;sender-&gt;user_email,$this-&gt;subject,$this-&gt;complaint,$this-&gt;answers,$this-&gt;sender));
  
          $path = "{mypath.com:993/imap/ssl}Sent";
          $imapStream = imap_open($path,$this-&gt;sender-&gt;user_email,$this-&gt;sender-&gt;email_password);
          imap_mail_move($imapStream,$mail,$path);
          imap_close($imapStream);
  </code></pre>
  
  <p>Both ways it didn't worked out</p>
  
  <p>In ComplaintMail class, build function looks like :</p>
  
  <pre><code>    public function build()
      {
          return $this-&gt;from($this-&gt;sender)
                      -&gt;subject($this-&gt;subject)
                      -&gt;markdown('emails.complaint');
      }
  </code></pre>