hoaproject/Mail

Sample code doesn't work

Closed this issue · 5 comments

composer doesn't pull hoa/stream which is used setting up MTA, it should be mailer requirement to pull this in.

Sorry for sloppy explanation, I'm in a hurry.

Hywan commented

Hello 😃,

What do you mean? I don't really understand your point.

Sorry for poor explanation. I'll try to explain it.

Consider example in readme:

Hoa\Mail\Message::setDefaultTransport(
    new Hoa\Mail\Transport\Smtp(
        new Hoa\Socket\Client('tcp://mail.domain.tld:587'),
        'gordon_freeman',
        '*********'
    )
);

It uses Hoa\Socket\Client which cannot will not be found if using composer require hoa/mail. You need to do composer require hoa/stream to fix that. So there are two ways to fix it. By adding hoa/stream dependency to hoa/mail project composer.json. Or modifying example where user needs to include dependency himself. But whats the poing og using composer if user needs to load dependencies.

Hope that helps.

Hywan commented

You mean by adding hoa/socket to composer.json.
That's correct. I don't know what it is missing… Fixing it right now.

You should check for yourself, maybe I'm missing something. But it seems like it's the case.