Este equipo de expertos despúes de ciertos días de investigación y de recopilar de información, dimos con los datos necesarios, esperamos que te resulte útil para tu plan.
Ejemplo 1: enlace de correo electrónico de JavaScript
<bodyonload="javascript: window.location.href='mailto:[email protected]';">
Ejemplo 2: secuencia de comandos java para enviar correo electrónico
<formid="javascript_form"><inputtype="text"name="subject"placeholder="Subject"/><textareaname="text"placeholder="Message">textarea><inputtype="submit"id="js_send"value="Send"/>form><script>//update this with your js_form selectorvar form_id_js ="javascript_form";var data_js ="access_token":"your access token"// sent after you sign up;functionjs_onSuccess()// remove this to avoid redirectwindow.location=window.location.pathname+"?message=Email+Successfully+Sent%21&isError=0";functionjs_onError(error)// remove this to avoid redirectwindow.location=window.location.pathname+"?message=Email+could+not+be+sent.&isError=1";var sendButton =document.getElementById("js_send");functionjs_send()
sendButton.value='Sending…';
sendButton.disabled=true;var request =newXMLHttpRequest();
request.onreadystatechange=function()if(request.readyState==4&& request.status==200)js_onSuccess();elseif(request.readyState==4)js_onError(request.response);;var subject =document.querySelector("#"+ form_id_js +" [name='subject']").value;var message =document.querySelector("#"+ form_id_js +" [name='text']").value;
data_js['subject']= subject;
data_js['text']= message;var params =toParams(data_js);
request.open("POST","https://postmail.invotes.com/send",true);
request.setRequestHeader("Content-type","application/x-www-form-urlencoded");
request.send(params);returnfalse;
sendButton.onclick= js_send;functiontoParams(data_js)var form_data =[];for(var key in data_js )
form_data.push(encodeURIComponent(key)+"="+encodeURIComponent(data_js[key]));return form_data.join("&");var js_form =document.getElementById(form_id_js);
js_form.addEventListener("submit",function(e)
e.preventDefault(););script>
Comentarios y puntuaciones
No se te olvide recomendar esta crónica si te ayudó.
¡Haz clic para puntuar esta entrada!
(Votos: 1 Promedio: 5)