Skip to content

Instantly share code, notes, and snippets.

@SergioCrisostomo
Created December 31, 2015 11:43
Show Gist options
  • Save SergioCrisostomo/60de7a702ea839a64b32 to your computer and use it in GitHub Desktop.
Save SergioCrisostomo/60de7a702ea839a64b32 to your computer and use it in GitHub Desktop.
function makeBody(to, from, subject, message) {
var btoa = require('btoa');
var str = ["Content-Type: text/plain; charset=\"UTF-8\"\n",
"MIME-Version: 1.0\n",
"Content-Transfer-Encoding: 7bit\n",
"to: ", to, "\n",
"from: ", from, "\n",
"subject: ", subject, "\n\n",
message
].join('');
return btoa(str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment