SSilence / php-imap-client

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

Class 'SSilence\ImapClient\SubtypeBody' not found in /home1/u8q7m3r8/public_html/require/phpimap/IncomingMessage.php:361 #176

Closed n00el closed 7 years ago

n00el commented 7 years ago

Hi! Every time I try to open a message, I got this message. I put every file from the ImapClient to my folder, but it said, SubtypeBody not found. What can I do?

`Fatal error: Uncaught Error: Class 'SSilence\ImapClient\SubtypeBody' not found in /home1/u8q7m3r8/public_html/require/phpimap/IncomingMessage.php:361 Stack trace:

0 /home1/u8q7m3r8/public_html/require/phpimap/IncomingMessage.php(178): SSilence\ImapClient\IncomingMessage->getBody()

1 /home1/u8q7m3r8/public_html/require/phpimap/IncomingMessage.php(159): SSilence\ImapClient\IncomingMessage->init()

2 /home1/u8q7m3r8/public_html/require/phpimap/ImapClient.php(640): SSilence\ImapClient\IncomingMessage->__construct(Resource id #26, 12, 'decode')

3 /home1/u8q7m3r8/public_html/cm/inc/foglalasok/foglalas/loadUzenetvaltas.php(33): SSilence\ImapClient\ImapClient->getMessage(12)

4 {main}

thrown in /home1/u8q7m3r8/public_html/require/phpimap/IncomingMessage.php on line 361
`

mattparksjr commented 7 years ago

Are you able to install via composer we highly recomend this

n00el commented 7 years ago

Thanks for your very fast reply! Okey, then i try it!

mattparksjr commented 7 years ago

Let me know! No problem

n00el commented 7 years ago

I try it with composer, but it is still hard for me! :)

But I found a solution: If I require all files at first, (not only that some what I find in this doc: http://ssilence.github.io/php-imap-client/gettingstarted.html) it's working.

require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/ImapClientException.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/ImapConnect.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/ImapClient.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/Section.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/Helper.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/IncomingMessage.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/IncomingMessageAttachment.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/TypeAttachments.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/TypeBody.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/SubtypeBody.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/OutgoingMessage.php"; require_once $_SERVER['DOCUMENT_ROOT']."/require/phpimap/AdapterForOutgoingMessage.php";

mattparksjr commented 7 years ago

When using composer are you using the auto loader?

n00el commented 7 years ago

Yes! And sorry for askint it there, but can I search with this library? For e.g. only list emails from a specific email? Like imap_search?

mattparksjr commented 7 years ago

Just got a pc so sorry for not replying. The readme contains a link to the docs :D

uomopalese commented 5 years ago

I get a Fatal error: Uncaught Error: Class 'Imap' not found, even with the suggested workaround

cbielich commented 5 years ago

I had same issue. I can't use composer so I added more requires like n00el did and it finally worked.