views:

561

answers:

2

Hi friends,

I want to email a web page through javascript. Its enough to open the outlook new mail option. I try to move a Here i am using mailto: option in html. Actually i am try to create a dynamic email template and want to send that template in html format.

Its showing error "comment line argument is not valid. verify the switch you are using" please get me the solution.

+3  A: 

Javascript can't send e-mails. Your best bet is the <a href="mailto:[email protected]">e-mail me</a> syntax. There is a convention that most browsers suppors that lets you set the contents of various attributes as well.

<a href="mailto:[email protected]?subject=Hi&body=hello%2C+there%21">e-mail me</a>

It will have to be URL encoded, and as far as I know, there is no reliable way to pass HTML. You have to assume plain text emails.

August Lilleaas
+1  A: 

You really need the server's help to make this easier.

1) Have the server make an XMLHTTP request to the page that generates the HTML you want. Grab it and make it the mail body.

  • or -

2) Grab the innerHTML, stick it in a hidden textarea and post it back to the server. Use the posted form field in the mail body.

Diodeus