简体   繁体   中英

send an email from a HTML/CSS/JS app

I am developping a mobile HTML/CSS/JS app with a contact form. For now I use a "mailto" to send the message, but it is not efficient because the user is sent to his email app before sending. How can I send the message directly from the app ?

thanks

编写一个在您网站的服务器上运行的应用程序。

If you don't want any server side code then you either need to use any third party Javascript application. (API)

or you can try this also :

<a href="mailto:emailaddress">Email</a>

1) For third party API you can try this also (Never tried it but looks good enough)

www.mycontactform.com

2) Mail Chimp (as Robert suggested)

You will not be able to do this purely from javascript. You will need a server side component to connect to an SMTP server in order to be able to send your email.

Even if you were able to somehow develop an SMTP client for javascript, the security risks involved would much outweigh the advantages. All your users will need to do to send email as you, is to go through your javascript code and get your SMTP credentials.

You can't do it by client side language. Use server side language like php to do that.

<?php
     mail(to,subject,message,headers,parameters);
?>

Copied from w3school

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM