Send web page via javascript

I want to send email via a webpage via javascript. It is enough to open a new mail option. I am trying to move a here I am using mailto: option in html. I'm actually trying to create a dynamic email template and want to send this template in html format.

The error "comment line argument" is invalid. check that you use the switch "please give me a solution.

+3
source share
4 answers

Javascript cannot send emails. The best syntax <a href="mailto:foo@bar.com">e-mail me</a>. There is an agreement that most browsers suppors, which allows you to set the contents of various attributes as well.

<a href="mailto:foo@bar.com?subject=Hi&body=hello%2C+there%21">e-mail me</a>

It must be encoded in the URL, and as far as I know, there is no reliable way to transmit HTML. You must accept simple text messages.

+6
source

You really need server help to make this easier.

1) Make the server request XMLHTTP on a page that generates the necessary HTML code. Take it and make it a mailbox.

  • or -

2) innerHTML, textarea . .

+2

, . Outlook , . - , - Outlook .

, , , .

+1

There are security restrictions that limit its operation directly. Yes, if you want Outlook specifically, you can start messing with ActiveX, but this is inconvenient and limited by some operating systems, settings, and security settings.

It is much better to use mailto: URL. It is cross-platform and supports any email client by default.

0
source

Source: https://habr.com/ru/post/1705577/


All Articles