Commit451 / mailgun

Mailgun client in Kotlin for server and Android usage
Apache License 2.0
22 stars 2 forks source link

How to attach a file? #7

Closed B1or closed 4 years ago

B1or commented 4 years ago

How to attach a file? What type of Attachment is and how to convert a file to attachment?

Jawnnypoo commented 4 years ago

See https://square.github.io/okhttp/recipes/#posting-a-file-kt-java

file.asRequestBody("text/x-markdown; charset=utf-8".toMediaType())