commit 73ec7984353547223bdbef14d27ea958408f8cb3
parent ad9a5e48eed405b6b4f84b8371312b70ab32e04d
Author: Ikrom <ikrom@tocobox.com>
Date: Sat, 18 Oct 2014 15:25:35 +0500
Readme.md
Diffstat:
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/Readme.md b/Readme.md
@@ -0,0 +1,30 @@
+mime-js
+=======
+
+Sometimes you need to create MIME message in browser. With *mime-js* you can create expected MIME message text. This project is created with Play framework, sbt.
+
+Usage
+-----
+
+Call **createMimeMessage** function with *mail* object:
+
+```javascript
+var mail = {
+ "to": "email1@example.com, email2@example.com",
+ "subject": "Today is rainy",
+ "fromName": "John Smith",
+ "from": "john.smith@mail.com",
+ "body": "Sample body text",
+ "cids": [],
+ "attaches" : []
+}
+createMimeMessage(mail);
+```
+
+**cids** - For inline images
+**attaches** - any file in base64 format
+
+You may need to look into [mime-js.coffee][1] ([mime-js.js][2])
+
+ [1]: https://github.com/ikr0m/mime-js/blob/master/app/assets/javascripts/mime-js.coffee
+ [2]: https://github.com/ikr0m/mime-js/blob/master/public/javascripts/mime-js.js
+\ No newline at end of file
diff --git a/app/views/index.scala.html b/app/views/index.scala.html
@@ -15,6 +15,7 @@
<div id="mime"></div>
<script type="application/javascript">
+ // To escape `at` symbol in play framework, we use double `at` in email
var mail = {
"to": "email1@@example.com",
"subject": "Today is rainy",