using mailto in form action attribute

Posted on 2002-04-10
Last Modified: 2010-04-09
How do I get the mailto in my form action attribute to simply email the contents of the form, instead of calling up my email program.  I have
<FORM action="">

and it calls up my Eudora, which is not what I want.  Is there a way to email the form input directly (unformatted, I know) without having to write a script?
Question by:ironfingers
LVL 53

Accepted Solution

COBOLdinosaur earned 100 total points
ID: 6932224
The mailto protocol has to have an email client.  It will invoke whatever the user has installed, as the default email client.  The browser by itself cannot email anything.  So if you use mailto you are dependent on an email client, or you have to have a script on the server side to process the form.

LVL 10

Expert Comment

ID: 6932279
An alternative is to use CDONTS which has to have SMTP running on the server.  It runs on an ASP page.
LVL 51

Expert Comment

ID: 6932294
> Is there a way to email the form input directly (unformatted, I know) without having to write a script?

Short answer: no.
Long answer: it might be possible using JavaSript, ActiveX or any other (dangerous) scripting, but be prepared that you never get a solution which works everywhere, always, as you expect
LVL 18

Expert Comment

ID: 6932431
>>Is there a way to email the form input directly
(unformatted, I know) without having to write a script?

NOPE...but the scripts to send mail are very easy.  Can you use ASP or ColdFusion or any server side scripting language?
LVL 10

Expert Comment

ID: 6932465
Just in case you can run ASP (and the server supports sending mail), here's a sample script:

recipients = request.form("recipients")
from_name = request.form("from_name")
form_element = request.form("form_element")

Set objCDOMessage = Server.CreateObject("CDONTS.NewMail")
' creates the object
     objCDOMessage.From =  from_name ' the address listed as "From"
objCDOMessage.To =  recipients ' the address listed as "To"
' you could include bcc and cc recipients as well
objCDOMessage.Subject = "The Subject Line" ' specify the subject header
objCDOMessage.Body = "Here is what was on the form:" & vbcrlf &_
 "Some text:" & form_element
     'now send the message

'wrap things up
Set objCDOMessage = Nothing
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

LVL 53

Expert Comment

ID: 6932491

>>>Is there a way to email the form input directly
(unformatted, I know) <em><b><font size=48pt>without having to write a script?</font></b></em>

LVL 53

Expert Comment

ID: 6932495
LVL 10

Expert Comment

ID: 6932500
Ok, ok, ok.  I agree, the answer to the question asked is "no".  :-)

Author Comment

ID: 6932790
I know PHP.  Hopefully the server supports it.
LVL 53

Expert Comment

ID: 6933575
Glad we could help.  Thanks for the A. :^)


Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now