开发者

Simple way to send e-mail using javascript

开发者 https://www.devze.com 2023-01-08 17:40 出处:网络
I wanted to know how to send e-mail using javascript. I dont want to use long functions withtag n all other stuff. Interested in only one/two liner statement which will allow me to send mail.

I wanted to know how to send e-mail using javascript. I dont want to use long functions with tag n all other stuff. Interested in only one/two liner statement which will allow me to send mail.

I have used s开发者_运维技巧omething like that earlier :

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;">

I dont want to use above approach to send mail...

Please provide me your suggestion so that i can send mail very easily by using javascript , like below. e.g.

function sendmail () {
location.href="mailto:<other stuff>"
}

Is anyone has any idea about this, please share their ideas here.

Thanks a lot....


As far as I know there is no other way to send an e-mail from client side with javascript. You can write some server side code or you can find some service to send e-mail. Unfortunaltely I dont know any web application that gives that kind of service. But, I was writing a web application that have limited e-mail functionality added. It is not finished yet (but still usable).Address is http://postdatabase.appspot.com Like I said it is not finished yet, that's why I suggest you to find a completed product. if you decide to use it please contact me from the site, so I can be more carruful to make changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号