genkgo/mail

How to add attachments to PlainTextMessage

riku22 opened this issue · 7 comments

Hello.

I started using this library.
But there is one thing I don't understand.
I am composing a plain text message with "PlainTextMessage".
How can I add an attachment to this message?
"withAttachment" doesn't seem to be available in "PlainTextMessage".
If there is any good way, I would appreciate any advice.

Best regards.

I think if you create a message with $bodyCollection = new MessageBodyCollection(); and then call $bodyCollection = $bodyCollection->withAlternativeText(); you can then attach attachments.

Hello.

Thank you.
I've actually tried AlternativeText, but I have one problem.
AlternativeText trims some characters, such as whitespace at the end of the line.
Is there a way to suppress this?

Best regards.

Nope. I could add a PR to get this done next week.

Hello.

OK.
I am looking forward to it.
Thank you.

Best regards.

See PR #94. Will merge later today, and create a tag.

Hello.

Thank you very much.
As far as I've tried it, it seems to work as I expected.
Excuse me, but let me ask you another question.
* If it is better to report it as a separate issue, please point it out.
AlternativeText is currently Base64 encoded, is there a way to change it to 8Bit?
I'm sorry for asking so many questions.

Best regards.

Sure. Can you create a separate issue with your email content (test message)? It supposed to be auto-detected which encoding to use.