<!doctype html>
<head>
<title>Webmail with No HTML Body - RJM Programming - May, 2019</title>
<script type='text/javascript'>

function ask() {
var eno=1;
var toemail='';
var subjectemail='';
var bodyemail='', thisbody='';
var bi=1, ldelim='';

while (eno > 0) {
while (toemail == '') {
toemail=prompt('Please enter email ' + eno + ' To (and you can, optionally, comma separate a CC and a BCC)', '');
if (toemail == null) { toemail=' '; }
}

if (toemail.indexOf('@') != -1) {
while (subjectemail == '') {
subjectemail=prompt('Please enter email ' + eno + ' Subject', '');
if (subjectemail == null) { subjectemail=' '; }
}
} else {
eno=0;
}

if (toemail.indexOf('@') != -1 && subjectemail.trim() != '') {
if (bodyemail == '') {
thisbody=prompt('Please enter email ' + eno + ' Body line ' + bi + ' ... if no more leave blank ... any ~` combination maps to linefeed', '');
if (thisbody == null) { thisbody=''; }
bodyemail+=ldelim + thisbody.replace(/\~\`/g, String.fromCharCode(10));
bi++;
ldelim=String.fromCharCode(10);
while (thisbody != '') {
thisbody=prompt('Please enter email ' + eno + ' Body line ' + bi + ' ... if no more leave blank ... any ~` combination maps to linefeed', '');
if (thisbody == null) { thisbody=''; }
bodyemail+=ldelim + thisbody.replace(/\~\`/g, String.fromCharCode(10));
bi++;
}

var pppform = new FormData();
var ppxhr = new XMLHttpRequest();
pppform.append("to", toemail);
pppform.append("subject", subjectemail);
pppform.append("body", bodyemail);
ppxhr.open('post', 'emailhtml.php', true);
ppxhr.send(pppform);


}
}
eno++;
toemail='';
subjectemail='';
bodyemail='';
thisbody='';
bi=1;
ldelim='';
}
}

ask();

</script>
</head>