Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"How to email a form "

Status
Not open for further replies.

meenakshidhar

Programmer
Oct 19, 2001
77
MY
Dear friends,
My problem is----
I have one Html form for registration. On click of Submit button i want to send this form to someones email address. so what i have done is--

<FORM METHOD=POST ACTION=&quot;mailto:sanjeev@iic.ac.in&quot; ENCTYPE=&quot;text/plain&quot;>

but the ouput which i am getting at my mail address is something like---
name=abc
class=pg
.
.
and so on....
so i m getting ouput in a very strange manner...please tell me some another way so that i will get output in some usual format.
 
You can do it with the CDONTS object in ASP.

You will need to make sure that the SMTP server is running in IIS. Create a test page and copy the code below into it. Make sure there is a valid address in the mail.to line. Place the page into your ASP application and load it from a browser.

Then wait and see if you receive an email. If so, let me know and I'll show you how you can format mail, and even send HTML mail that can be nice a pretty.


<%@ Language=VBScript %>
<% Option Explicit %>
<%
dim mail
set mail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
mail.to = &quot;sanjeev@iic.ac.in&quot;
mail.from = &quot;sanjeev@iic.ac.in&quot;
mail.subject = &quot;Testing Mail From ASP Application&quot;
mail.body = &quot;Is it possible to send mail dynamically through ASP. The answer is Yes !!&quot;
mail.send
set mail = Nothing

Response.Write &quot;You should be receiving the email shortly !&quot;
%>


Happy Mailing :)

ToddWW
 
One more reason to use ToddWW's method is that the <form action=&quot;mailto:email@address.com&quot;> no longer works in the newer browsers. Instead of sending your mail it will just pop up your email program.

Roj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top