< home > last update: 6-27-2021  :: (this URL) http://hansandcassady.org/About-GD-Mail-Test-Example.html


<UI  < email sent


EXAMPLE SHRED of code contained here  > http://hansandcassady.org/Mail-TEST-NEW-6-26-2021.html   

 https://www.w3schools.com/tags/tag_script.asp

<!DOCTYPE html>  https://www.w3schools.com/tags/tag_doctype.asp  ::  https://en.wikipedia.org/wiki/Document_type_declaration

<html> https://www.w3schools.com/tags/tag_html.asp

  <head> https://www.w3schools.com/tags/tag_head.asp

<meta charset="utf-8">  https://www.w3schools.com/tags/tag_meta.asp   ::  https://www.w3schools.com/tags/att_meta_charset.asp

                <title>Mail Test</title>  https://www.w3schools.com/tags/tag_title.asp

                <style type="text/css">td  https://www.w3schools.com/tags/tag_style.asp  :: "The default value is "text/css", which indicates that the content is CSS."

                                                                {

                vertical-align: top;

                                                                }

                </style>

  </head>

 <body>  https://www.w3schools.com/tags/tag_body.asp  

<h1>Mail Test</h1>  https://www.w3schools.com/tags/tag_hn.asp  ::  HTML <h1> to <h6> Tags 

    [ https://www.w3schools.com/tags/tag_form.asp  ::  HTML <form> Tag ]

    [  The <form> element can contain one or more of the following form elements:  ] < FORM ELEMENTS ::     [<input>,<textarea>,<button>,<select>,<option>,<optgroup>,<fieldset>,<label>,<output>]

    [ATTRIBUTES  ]

 [   HTML comment https://www.w3schools.com/html/html_comments.asp 
    <!-- comments here -->  ]

 [   JavaScript comment   https://www.w3schools.com/js/js_comments.asp ]
                    Any text between // and the end of the line will be ignored by JavaScript (will not be executed).

<form id="mailform" name="mailform">

// To: <input name="toemail" size="40" type="text" value="" /><br />

From: <input name="from" size="40" type="text" value="" /><br />

Subject: <input disabled="disabled" name="subject" size="40" type="text" /> auto <input checked="checked" name="autosubject" onchange="AutoSubject();" type="checkbox" /><br />

Message:<br />

<textarea cols="40" name="message" rows="15">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed tempor incididunt ut labore et dolore magna aliqua. </textarea><br />

<button id="sendemail" onclick="GoSend(); AutoSubject();" type="button">Send</button> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method&nbsp;<select name="sendmethod" onchange="AutoSubject();"><option value="mail">PHP mail()</option><option value="smtp">SMTP</option><option value="sendmail">sendmail from shell</option> </select>

 </form>

<p></p>  https://www.w3schools.com/tags/tag_p.asp  

<p></p>

<hr />  https://www.w3schools.com/tags/tag_hr.asp  

<p></p>

<p></p>

  [  https://www.w3schools.com/tags/tag_table.asp    ]

<table border="1" bordercolor="#FFCC00" cellpadding="3" cellspacing="3" id="msglog" style="background-color:#FFFFCC" width="100%">

                <tbody>  https://www.w3schools.com/tags/tag_tbody.asp  

                                <tr>  https://www.w3schools.com/tags/tag_tr.asp

                                                <td>#</td>  https://www.w3schools.com/tags/tag_td.asp   

                                                <td>TIME</td>

                                                <td>TO</td>

                                                <td>FROM</td>

                                                <td>SUBJECT</td>

                                                <td>MESSAGE</td>

                                                <td>METHOD</td>

                                                <td>NODE</td>

                                                <td>RESULT</td>

                                </tr>

                </tbody>

</table>

                                <script>   https://www.w3schools.com/tags/tag_script.asp  [ The <script> tag is used to embed a client-side script (JavaScript). ]

   [ JavaScript  https://www.w3schools.com/js/  ]

var msgid = 1;  https://www.w3schools.com/jsref/jsref_var.asp

AutoSubject();    [ https://www.w3schools.com/jsref/jsref_function.asp  ...In JavaScript, functions are objects, and they have both properties and methods.SYNTAX, PARAMETER VALUES, ... ]

function AutoSubject() {

                if ( document.mailform.autosubject.checked ) {

                                document.mailform.subject.disabled=true;

                                document.mailform.subject.value='Test email using '+document.mailform.sendmethod.value+' #'+msgid;

                } else {

                                document.mailform.subject.disabled=false;

                }

}

function GoSend() {

                var table=document.getElementById("msglog"); 

     [  https://www.w3schools.com/jsref/jsref_var.asp   : After the declaration, the variable is empty (it has no value). To assign a value to the variable, use the equal sign: ]

                var row = table.insertRow(1);

                var NUMcell = row.insertCell(0);

                NUMcell.innerHTML=msgid++;

                var DATEcell = row.insertCell(1);

                var d = new Date();

                DATEcell.innerHTML=d.toLocaleTimeString();

               

                var TOcell = row.insertCell(2);

                TOcell.innerHTML=document.mailform.toemail.value;

               

                var FROMcell = row.insertCell(3);

                FROMcell.innerHTML=document.mailform.from.value;

               

                var SUBJECTcell = row.insertCell(4);

                SUBJECTcell.innerHTML=document.mailform.subject.value;

               

                var MESSAGEcell = row.insertCell(5);

                MESSAGEcell.innerHTML=document.mailform.message.value;

               

                var METHODcell = row.insertCell(6);

                METHODcell.innerHTML=document.mailform.sendmethod.value;

               

                var NODEcell = row.insertCell(7);

               

                var RESULTcell = row.insertCell(8);

                RESULTcell.innerHTML="<img height=\"24\" src=  https://www.w3schools.com/tags/att_script_src.asp

\"data:image/gif;base64,R0lGODlhEAAQAPYAAP

///wAAANTU1JSUlGBgYEBAQERERG5ubqKiotzc3KSkpCQkJCgoKDAwMDY2Nj4+Pmpqarq6uhwcHHJycuzs7O7u7sLCwoqKilBQUF5eXr6+vtDQ0Do6OhYWFoyMjKqqqlxcXHx8fOLi4oaGhg4ODmhoaJycnGZmZra2tkZGRgoKCrCwsJaWlhgYGAYGBujo6PT09Hh4eISEhPb29oKCgqioqPr6+vz8/MDAwMrKyvj4+NbW1q6urvDw8NLS0uTk5N7e3s7OzsbGxry8vODg4NjY2PLy8tra2np6erS0tLKyskxMTFJSUlpaWmJiYkJCQjw8PMTExHZ2djIyMurq6ioqKo6OjlhYWCwsLB4eHqCgoE5OThISEoiIiGRkZDQ0NMjIyMzMzObm5ri4uH5+fpKSkp6enlZWVpCQkEpKSkhISCIiIqamphAQEAwMDKysrAQEBJqamiYmJhQUFDg4OHR0dC4uLggICHBwcCAgIFRUVGxsbICAgAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAHjYAAgoOEhYUbIykthoUIHCQqLoI2OjeFCgsdJSsvgjcwPTa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RUbYEdUNjoiGlZWQYM2QD4vhkI0ZWKCPQmtkG9SEYJURDOQAD4HaLuyv0ZeB4IVj8ZNJ4IwRje/QkxkgjYz05BdamyDN9uFJg9OR4YEK1RUYzFTT0qGdnduXC1Zchg8kEEjaQsMzpTZ8avgoEAAIfkECQoAAAAsAAAAABAAEAAAB4iAAIKDhIWFNz0/Oz47IjCGADpURAkCQUI4USKFNhUvFTMANxU7KElAhDA9OoZHH0oVgjczrJBRZkGyNpCCRCw8vIUzHmXBhDM0HoIGLsCQAjEmgjIqXrxaBxGCGw5cF4Y8TnybglprLXhjFBUWVnpeOIUIT3lydg4PantDz2UZDwYOIEhgzFggACH5BAkKAAAALAAAAAAQABAAAAeLgACCg4SFhjc6RhUVRjaGgzYzRhRiREQ9hSaGOhRFOxSDQQ0uj1RBPjOCIypOjwAJFkSCSyQrrhRDOYILXFSuNkpjggwtvo86H7YAZ1korkRaEYJlC3WuESxBggJLWHGGFhcIxgBvUHQyUT1GQWwhFxuFKyBPakxNXgceYY9HCDEZTlxA8cOVwUGBAAA7AAAAAAAAAAAA\">";

               

                var postdata= "sendemail=1&toemail="+document.mailform.toemail.value;

                    postdata+="&from="+document.mailform.from.value;

                    postdata+="&subject="+document.mailform.subject.value;

                    postdata+="&sendmethod="+document.mailform.sendmethod.value;

                    postdata+="&message="+encodeURIComponent(document.mailform.message.value).replace("%20", "+");

                var url="/mail_test.php";

                var request=new XMLHttpRequest();  https://www.w3schools.com/js/js_ajax_http.asp  ::  https://www.w3schools.com/js/js_ajax_http_send.asp   " ...used to request data from a server. "

                request.open("POST",url,true);  [ https://www.w3schools.com/xml/ajax_xmlhttprequest_send.asp  : https://www.javascripture.com/Request   ]

                request.setRequestHeader("Content-type","application/x-www-form-urlencoded");

                request.overrideMimeType("text/plain");

                request.onreadystatechange=function() {

                                if ( request.readyState==4 ) {

                                                NODEcell.innerHTML=request.getResponseHeader("X-Node");

                                                if ( request.responseText == "OK" || request.responseText == "FAIL" ) {

                                                                RESULTcell.innerHTML=request.responseText;

                                                } else {

                                                                if ( request.status == 0 ) {

                                                                                RESULTcell.innerHTML="ERR_EMPTY_RESPONSE";

                                                                } else {

                                                                                RESULTcell.innerHTML="HTTP/1.1 "+request.status+" "+request.statusText+"<br /><br />"+request.responseText;

                                                                }

                                                }

                                }

                }

                request.send(postdata);   https://stackoverflow.com/questions/14873443/sending-an-http-post-using-javascript-triggered-event  ::  https://www.w3schools.com/xml/xml_http.asp

}

                                 </script>

</body>

</html>


hhh  hhh


 eCHOED to screen: 

To: SusanCN@HansANDcassady.org

From: SusanCN@HansANDcassady.org

Subject: Test email using mail #2 ( NOTE SUBJECT OF EMAIL REC'D IS DIFFERENT)
 auto  (AND CHECK BOX DISPLAYED)
Message:
Lorem Susan Susan 

TEST 6-27-2021 5:10PM

Send                Method 
PHP mail()

(TABLE ROW DISPLAYED) var row = table.insertRow(1);</p>  https://www.w3schools.com/jsref/met_table_insertrow.asp
( cELLS IN row POPULATED ) ( var NUMcell = row.insertCell(0)  <  CODE...  https://www.w3schools.com/jsref/met_tablerow_insertcell.asp


CELL Cell(0)  Cell(1) Cell(2)  Cell(3)  Cell(4) Cell(5)  Cell(6) Cell(7)  Cell(8) 
var  #  TIME TO FROM SUBJECT MESSAGE METHOD NODE RESULT
value 1 5:10:27 PM email@HansANDcassady.org
 email
email@HansANDcassady.org
 email
Test email using mail #1 Lorem Susan Susan
TEST 6-27-2021 5:10PM
mail  a2plcpnl0655 HTTP/1.1 200 OK  OK

 HHH

<p>function GoSend() {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var table=document.getElementById(&quot;msglog&quot;);&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; [&nbsp; <a href="https://www.w3schools.com/jsref/jsref_var.asp">https://www.w3schools.com/jsref/jsref_var.asp</a> &nbsp;&nbsp;: After the declaration, the variable is empty (it has no value). To assign a value to the variable, use the equal sign: ]</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var row = table.insertRow(1);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var NUMcell = row.insertCell(0);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NUMcell.innerHTML=msgid++;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var DATEcell = row.insertCell(1);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var d = new Date();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DATEcell.innerHTML=d.toLocaleTimeString();</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var TOcell = row.insertCell(2);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TOcell.innerHTML=document.mailform.toemail.value;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var FROMcell = row.insertCell(3);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FROMcell.innerHTML=document.mailform.from.value;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var SUBJECTcell = row.insertCell(4);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SUBJECTcell.innerHTML=document.mailform.subject.value;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var MESSAGEcell = row.insertCell(5);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MESSAGEcell.innerHTML=document.mailform.message.value;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var METHODcell = row.insertCell(6);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; METHODcell.innerHTML=document.mailform.sendmethod.value;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var NODEcell = row.insertCell(7);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var RESULTcell = row.insertCell(8);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 RESULTcell.innerHTML=&quot;&lt;img height=\&quot;24\&quot; src=&nbsp;  [ https://www.w3schools.com/jsref/coll_table_cells.asp ]
<a href="https://www.w3schools.com/tags/att_script_src.asp">https://www.w3schools.com/tags/att_script_src.asp</a>
</p>
<p></p>

HHH


Mail Test

To:
From:
Subject: auto
Message:

               Method 


# TIME TO FROM SUBJECT MESSAGE METHOD NODE RESULT