SSilence / php-imap-client

a easy solution for simple IMAP email access in php
MIT License
268 stars 136 forks source link

send message not work? #197

Closed reimax closed 6 years ago

reimax commented 6 years ago

connect to mailbox, download message. now i try send message.

my code


            use SSilence\ImapClient\ImapClientException;
            use SSilence\ImapClient\ImapConnect;
            use SSilence\ImapClient\OutgoingMessage as ImapSend;
            use SSilence\ImapClient\ImapClient as Imap;

            $ImapSend = new ImapSend();

            $ImapSend->setFrom("my mail");
            $ImapSend->setTo("not my mail");
            $ImapSend->setSubject($message_subject);
            $ImapSend->setMessage($message_text);
            $ImapSend->setDate(); // this i add in OutgoingMessage class to set date

            $ImapSend->send();

message not send. how to correctly send a message? createBody() i replace to my variant


            public function createBody()
    {
        $part2['type'] = TYPETEXT;
        $part2['subtype'] = 'html';
        $part2["description"] = $this->subject;
        $part2['contents.data'] = "$this->message\n\n\n\t";
        $part2["charset"] = "utf-8";
        $body[1] = $part2;
        $this->body = $body;
             }
mattparksjr commented 6 years ago

Send message is currently not fully implmented