PHP and/or ASP

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

DJ [email protected]

Thread Starter
Joined
Aug 8, 2001
Messages
413
hey, i have a site and i want to make a form that has about 8 text fields and a submit button and when the button is pressed, it emails all the information entered to a certain address. is this possible without any add-ons installed on the server end??
please help
 
Joined
Jul 29, 2001
Messages
21,334
For ASP you can use their CDONTs already a part of ASP. It is a little limited but it works. Not sure about PHP tho. There are components like ASPmail you can buy for a minimal fee also.
 
Joined
Jul 29, 2001
Messages
21,334
THe only problem with ASp is finding a server that supports it. Almost all servers support CGI and it's not that hard to use. Didn't realize we were doing it for you tho.
 

DJ [email protected]

Thread Starter
Joined
Aug 8, 2001
Messages
413
well if there was someway i could learn it i would do it my self, but i think i got it under control, i have a pc world mag that tell me how to do something similar with PHP
 
Joined
May 25, 2000
Messages
409
This is a pretty simplistic demo but I think you will get the idea. Basically you have two text boxes one to act as the text to send and the other to fill in the email address.

Once submitted the information will be sent to the email address you entered. One thing to remember you will need a host that supports ASP, most Windows servers do. And you will need some sort of mail component. I used Jmail (free for personal use) but you can use any including CDONTS. You will just need to modify the script slightly to work with your component.

Edit - Since the HTML is turned on here at TSG the code was being displayed as regular HTML. You can see the code here:

Sending form contents in email (CDONTS) <--- edited to replace dead link.
 
Joined
Mar 28, 2001
Messages
781
Simple asp code:


This gets values from a previous page but you can submit to the page that processes the script. I just started working with php at home and have no clue how to do this in that yet, sorry.

(Please dismiss the .. before everything, I don't know how to get the code to appear otherwise)

Code:
<..%@ Language=VBScript %..>
<..%Option Explicit%..>
<..%Response.Buffer = True%..>
<..HTML..>
<..HEAD..>
<..Title><../Title..>
<..META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"..>
<../HEAD..>
<..BODY..>
<..%
	'Delcare variables here
	Dim MailObject
	Dim strFrom
	Dim strTo
	Dim strSubject
	Dim strMessage
		
	'Use these four lines if using method=post
	strFrom    = Request.Form("mailFrom")
	strTo      = Request.Form("mailTo")
	strSubject = Request.Form("mailSubject")
	strMessage = Request.Form("mailMessage")
	
	Set MailObject = Server.CreateObject("CDONTS.NewMail")

	MailObject.Importance=2
	MailObject.From=strFrom
	MailObject.To=strTo
	MailObject.Bcc="[email protected]"
	MailObject.Subject=strSubject
	MailObject.Body=strMessage

	MailObject.Send
			
	Set MailObject = nothing
%..>
<..Table align=center border=2 width=75% cellpadding=2 cellspacing=2..>
    <..tr..>
        <..td align=center><..H1>Your mail was sent</H1..></td..>
    <../tr..>
    <..tr..> 
        <..td..><..u..>To<../u..>:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<..font color="red"..><..%=strTo%..><../font..><../td..>
    <../tr..>
    <..tr..>
        <..td..><..u..>From<../u..>:&nbsp;&nbsp;&nbsp;&nbsp;<..font color="red"..><..%=strFrom%..><../font..><../td..>
    <../tr..>
    <..tr..>
        <..td..><..u..>Subject<../u..>:&nbsp;<..font color="red"..><..%=strSubject%..><../font..><../td..>
    <../tr..>
    <..tr..>
		<..td..><..u..>Message<../u..>:<..BR..>&nbsp;<..BR..><..f..ont color="red"..><..%=strMessage%..><../font..><../td..>
	<../tr>
<../Table..>
<../BODY..>
<../HTML..>
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top