Click me to copy

function sendFormByEmail(e) { var email = "forms@workhub.com"; var subject = 0; var doc = SpreadsheetApp.getActiveSpreadsheet(); subject = doc.getName(); var message = "*contents*<p><b><u>" + subject + "</u></b></p><br>"; var s = SpreadsheetApp.getActive().getSheetByName("Form responses 1"); var headers = s.getRange(1,1,1,s.getLastColumn()).getValues()[0]; for(var i in headers) { if(headers[i]!=null && e!=null) message += "<p><b>" + headers[i].toString() + "</b><br>" + e.namedValues[headers[i]].toString() + "</p>"; } MailApp.sendEmail(email, subject, "", {htmlBody: message}); }