Forum Moderators: open

Message Too Old, No Replies

JavaScript Mailto:

Emailing contents of text area

         

wellbornSun

8:34 pm on May 29, 2008 (gmt 0)

10+ Year Member



I know there has to be a simple solution for this, but it is escaping me.
I have a page where I want the mailto: link to send the contents to the above text area. This is the page:

<sorry, no personal urls>

Does anyone have any ideas on the best way to solve this?

[edited by: tedster at 10:53 pm (utc) on May 29, 2008]

lavazza

9:10 pm on May 29, 2008 (gmt 0)

10+ Year Member



For the simplest solution, you don't need any javascript

For a more elegant and robust solution, you might want to Google for
cgi formmail [google.com]

A simple mailto link with subject and body

%0A = <br>

%0A %0A = <br><br>

<a href="mailto:info@example.com?
subject=Lorem ipsum dolor sit amet
&amp;body=Dear Consectetuer,
%0A %0A Semper nonummy tortor donec lobortis, vitae interdum suspendisse nulla accumsan
massa tristique venenatis nunc sit amet nulla donec
%0A %0A Consectetuer quis, tellus sed auctor faucibus augue ut vitae nisi cras ornare ut quis
ipsum urna, venenatis non, tincidunt et, elementum vitae, metus duis
%0A %0A Eros at placerat volutpat, ante arcu rutrum quam, non laoreet metus tellus vel quam
erat sit amet eros sed mattis facilisis metus morbi ac mauris aliquam vel, mi et pellentesque risus
dignissim libero, ac vulputate
%0A %0A Yours sincerely
%0A Lorem I. Dolor">link text</a>

httpwebwitch

10:50 pm on May 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you can also set the "action" of a <form> to a mailto: address. But then you need to do a little hoohah with the ENCTYPE

e.g.
<FORM METHOD=POST ACTION="mailto:someone@example.com" ENCTYPE="text/plain">

try it

I haven't used this technique since Netscape 3 roamed the earth. I don't really know if it works any more

wellbornSun

2:11 am on May 30, 2008 (gmt 0)

10+ Year Member



Well, adding the whole thing inside the mailto: link is a wash. I'm gonna try formmail, which I have used before for simple forms, but this just seems a little different, and begs for another solution...I just don't know what it is.

httpwebwitch

6:42 am on May 30, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



are you perchance using PHP?
If so, you can roll your own mailing script with one command: mail().

Some of those old "tried-and-true" CGI scripts (remember Matt's Script Archive - circa 1995?) are actually great proxies for spammers, who may pass forged parameters into your form.