ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old July 2nd, 2003, 11:31 AM
missfunky missfunky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 missfunky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy help with form

Ok

Im very new to asp and programming so excuse me for sounding like a thickkie! ok heres me following code from an html form::

<form name="form1" method="post" action="mailto:abigailc@.....co.uk">
<p>Your name::</p>
<p>
<input name="textfield" type="text" size="40" maxlength="20">
</p>
<p>Email address::</p>
<p>
<input name="textfield2" type="text" size="40" maxlength="20">

</form> ** you get the idea....

anyway, ive put in my works email address for the recipent of the form, but when I receive the form from the site, i get an unknow file form, and my email screen is blank??

Is there any asp/vb code that can show the details on my screen, or convert the details in the form into a word doc??

Also, could i add an attachment button to my form that allows people to add attachments with the form??

Please help, im cluless...

xxxxxxxxx

Reply With Quote
  #2  
Old July 2nd, 2003, 12:33 PM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
---BEGIN QUOTE---
... i get an unknow file form, and my email screen is blank??
---END QUOTE---

What's an email screen is blank ?

Do you mean that your email has nothing in it? that its blank? the email that is!


---BEGIN QUOTE---
Is there any asp/vb code that can show the details on my screen, or convert the details in the form into a word doc??
---END QUOTE---

What do you mean by show the details on my screen ?

Then you ask convert the details in the form into a word doc.

What is it you want exactly?

Seems like your asking too many questions at the same time.

---BEGIN QUOTE---
Also, could i add an attachment button to my form that allows people to add attachments with the form??
---END QUOTE---

Humm...


Ok let's start from the beginning shall we!


1)
You have a <form>...</form> that once submitted, you would like to receive an email with the information entered in the/your <form>...</form> Is that correct?

2)
How would you like to receive that email?
Would you like to receive the content of your <form>...</form> inside the *body* of the email
OR
Would you like to take the content of your <form>...</form>, create a .doc(WORD) document and *then* attach this .doc to your email?

These are two different things and the approaches are different(one has more code)

As for your button that you would like to add so that *users* can browse for a file on *their* computer so that they can attach it to the email is yet another thing/approach.

To do that, you'll need what we call an *upload* component. Its a component that you register on your server(the one holding your .asp pages) that enables *users* to upload(send a file) to the server. Then you take that file and send an email with it(or attach that file as an attachment).

Always assume that the user is somewhere in Hawaii and that your server(web server) is somewhere in Hong Kong. Now how can a *user* send a file from his computer(Hawaii) to the web server(Hong Kong) ?

That's why you need an upload component that enables you the programmer to code such a thing.
Now, you *can* create your own upload component using VB for example OR simply buy one for like 35$ with code example!

I'd go with the 35$ personally save time and the components are reliable.

Oh but wait a second...maybe you're hosting your web site at some company and *that* company doesn't/won't allow you to use third party components. Make of that *before* you start coding anything.

Now back to your intial problem...the email part.

If all you want is to send an email with the content of your <form>...</form>. Then simply change a couple of things.

For example, have your <form>...</form> look something like:

<form name="frmMain" action="sendemail.asp" method="post">
. . .
. . .
. . . [submit button]
</form>

Notice the sendemail.asp inside the *action* attribute.
Once the user clicks on the [submit button] you'll send all the data of your <form>...</form> to the sendemail.asp page.

Create a sendemail.asp page that retrieves the data from your <form>...</form> put them into variables. Then use an email component to send your email. Something like:

<%
Dim strFirstName
Dim strEmailAddress
Dim objMail

strFirstName = Trim(Request.Form("txtFirstName"))
strEmailAdress = Trim(Request.Form("txtEmailAddress"))

'Validation of the email address if you want!
If strEmailAddress = "" Then
Response.Write "Please enter an email address."
Response.End 'or Response.Redirect
End If

Set objMail = Server.CreateObject("EasyMail.SMTP.5")

If NOT IsObject(objMail) Then
Response.Write "object not installed on the server, please install it and register it."
Response.End
End If


objMail.LicenseKey = ...
objMail.MailServer = ...
objMail.Subject = ...
objMail.BodyText = strFirstName & "<hr>"
objMail.FromAddr = ...
objMail.From = ...
objMail.BodyFormat =...
objMail.AddRecipient "", strEmailAdress , 1

objMail.Send
Set objMail = nothing

%>

In this example, I'm using the component EasyMail to send an email. EasyMail is easy to use and you can add attachments if you want but that's another story...

Check out the documentation *if you decide* to go with the EasyMail component to send your emails.

Hope this helps!
Sincerely

Vlince

Reply With Quote
  #3  
Old July 3rd, 2003, 04:12 AM
missfunky missfunky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 missfunky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
coor blimey gov' !!

I see what you mean, I asked too many questions and got myself confused! Right ok, what you put helped me out a great deal, but think Im going to stick with the basics

Ok, this is what i have in my form field::

<form name="form1" method="post" action="AbigailC@***.co.uk">

with 3 text fields named : name, email and comments

just for now all I want is for the details to be sent to my email , so I can open the email and see the details filled in from the form, for some reason its not letting me see it??

if u can help that would be brilliant, please dont give up on me!!


Reply With Quote
  #4  
Old July 4th, 2003, 07:58 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Ok try this *simple* asp page!


--------------------------------------------------------------------------
<%@ Language=VBScript %>

<html>
<head>
</head>
<body>

<form method="post" action="mailto:test@test.com" enctype="text/plain">
<input type=text name=your_comments>
<input type=submit value="Submit Your Comments">
</form>

</body>
</html>
--------------------------------------------------------------------------

Notice the mailto: inside the *action* attribute
Also notice the *enctype* attribute.

Hope this helps!
Sincerely

Vlince

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > help with form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway