How can we send mail using JavaScript?

Answer Posted / ramesh

At jsscript tag

function sendmail(_frm)
{
var eml="you@youraddress.com";
var bod="&body="+_frm.selOne.value+" ¦¦ "+_frm.txtOne.value;
var subj="?subject=Whatever you want";
location.href="mailto:"+eml+subj+bod;
}

At Form tag
<form action="mailto:you@youraddress.com"
enctype="text/plain"
method="POST" onsubmit="sendmail(this);return false;">

Is This Answer Correct ?    28 Yes 30 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between isset and empty in php?

544


What is the difference between $message and $$message in php?

434


How do you count numbers in php?

516


what is the use of include_once in php?

546


How can php and javascript interact?

753






Do you know what does $globals means?

568


What is isset post?

579


I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what is the problem?

513


How do I display php errors?

525


Is php a framework?

531


List types of array are available in php?

557


What is use of header() function in php?

556


Explain what is the function file_get_contents() usefull for?

515


What are escaping characters? Explain with an example?

523


What is the difference between "echo" and "print" in php?

530