Commit451 / mailgun

Mailgun client in Kotlin for server and Android usage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to attach a file?

B1or opened this issue · comments

commented

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

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

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