Is there a way to write a simple email with Kotlin? I just want to send some Text. I already tried commons email but i can not import it... Is there also a way without Java Code?
Thanks
Is there a way to write a simple email with Kotlin? I just want to send some Text. I already tried commons email but i can not import it... Is there also a way without Java Code?
Thanks
Kotlin is just a language; it's up to the platform to provide that sort of functionality.
If you're running on the JVM, then there are many libraries which can do this for you. The most standard is probably javax.mail; questions such as this one show how to call it from Java, but you can access it from Kotlin in much the same way.
If you're running on Android, then that probably has its own library you can use. Similarly on JavaScript, there may be APIs you can use. (I don't know anything about those platforms, I'm afraid.)
If you're running Kotlin Native, then you may have a native program you can call.
Finally, many platforms have a stand-alone program you could run, such as the mailx
program on macOS and Unix. See this question for ways to run an external program from Kotlin; though you'd need to check that whichever program you wanted was available on the machine (or install it yourself).