express-server/express-api-server/email/main.js
/**
* Receive details about the email and convert a base64 encoded
* string form.
* @param  {String} userId User's email address. The special value 'me'
* can be used to indicate the authenticated user.
* @param {String} receiverID receiver's email ID.
* @param {String} subject Subject of the email.
* @param {String} emailBody Email message to be sent.
*/
Receive details about the email and convert a base64 encoded
string form.
Receive details about the email and convert a base64 encoded string form .
function createEmail(userID = 'me', receiverID, subject, emailBody){
    var message = [
        "Content-Type: text/html; charset=\"UTF-8\"\n",
        "MIME-Version: 1.0\n",
        "Content-Transfer-Encoding: 7bit\n",
        "to: ", receiverID, "\n",
        "from: ", userID, "\n",
        "subject: ", subject, "\n\n",
        emailBody
    ].join('');
    message = base64.encode(message).replace(/\+/g, '-').replace(/\//g, '_');
    return message;
}
function createEmail ( userID = 'me' , receiverID , subject , emailBody ) { var message = [ "Content-Type: text/html; charset=\"UTF-8\"\n" , "MIME-Version: 1.0\n" , "Content-Transfer-Encoding: 7bit\n" , "to: " , receiverID , "\n" , "from: " , userID , "\n" , "subject: " , subject , "\n\n" , emailBody ] . join ( '' ) ; message = base64 . encode ( message ) . replace ( / \+ / g , '-' ) . replace ( / \/ / g , '_' ) ; return message ; }
Receive details about the email and convert a base64 encoded
string form.
Receive details about the email and convert a base64 encoded string form .