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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is the differnce between an ac

Status
Not open for further replies.

GoLdFiNgeR

IS-IT--Management
Jun 4, 2002
252
US
what is the differnce between an active server page and an html page?

i just made a form, so does it matter if i post it as a .asp or .html? will it work either way?

any insight is greatly appreciated
 
ohh im sorry i forgot you cant see it, should i post it or email it, its pretty long, but here it is

<%@ LANGUAGE=&quot;JSCRIPT&quot;%>
<%/*--------------------------------------------------------------
|
| Tradesmen International, Inc.
| Copyright 2002 Tradesmen International
| Written by William McGreevy
|
| Filename: formsu~1.asp
| Created: 1-24-02
|
| Modifications: 1-24-02 Model Email page after PLTC Jscript
| 2-04-02 Remove the Array selection, straight email
| 2-12-02 Add radio buttons for contact selection
------------------------------------------------------------------*/%>

<%
/***********************************************
* Submit Definition (Constant)
*/

//** Email Form Control Definitions ****
var PLT_EMAIL_SUBMIT = &quot;Submit&quot;; // SUBMIT Button

/***********************************************
* Post Email Message
*
*/

function PLT_PostEmail()
{
var bToFilled = false;
var strNormFont = &quot;<font face = \&quot;Verdana, Arial, Helvetica, sans-serif\&quot; color=\&quot;#006600\&quot;>&quot;;

// if no submit button do nothing
/**/ if( Request.Form( PLT_EMAIL_SUBMIT ).Count == 0 )
return false;

// Gather everything from POSTing form
var strFromName = Request.Form.Item( &quot;name&quot; );
var strFromEmail = Request.Form.Item( &quot;emailadd&quot; );
/**/ var strFromPhone = Request.Form.Item( &quot;phone&quot; ) + &quot; Ext.&quot; + Request.Form.Item( &quot;ext&quot; );
/**/ var strContactPref = Request.Form.Item( &quot;prefer&quot; );
/**/ var strContactMsg = &quot;I would prefer to be contacted by &quot; + strContactPref + &quot;.&quot;

var strToName = &quot;Tradesmen International&quot;;
/**/ var strMsg = Request.Form.Item( &quot;comments&quot; ) + &quot;\n\n Sincerely,\n &quot; + strFromName + &quot;\n &quot; + strFromPhone + &quot;\n&quot;;

// Allow user to NOT fill in their name
if( strFromName == &quot;&quot;) strFromName = &quot;(anonymous)&quot;;

/*****/

// mail object set up
var nmStaff = Server.CreateObject ( &quot;CDONTS.Newmail&quot; );
nmStaff.From = strFromEmail != &quot;&quot; ? strFromEmail : &quot;wmcgreevy@tradesmen-intl.com&quot;;
nmStaff.To = &quot;wmcgreevy@tradesmen-intl.com&quot;;
nmStaff.Subject = &quot;Web Site Contact Form&quot;;
nmStaff.Body = strContactMsg + &quot;\n\n&quot; + strMsg;
nmStaff.Send();

//mail object set up for Autoreply
// if From Email address equals nothing don't do anything, else do this
if( strFromEmail != &quot;&quot; ) {
var nmAutoreply = Server.CreateObject( &quot;CDONTS.Newmail&quot; );
nmAutoreply.From = &quot;autoreply@tradesmeninternational.com&quot;;
nmAutoreply.To = strFromEmail;
nmAutoreply.Subject = &quot;Web Site Contact Conformation Form&quot;;
/**/ nmAutoreply.Body = &quot;Thank you for your comments or requests.\n&quot; + &quot;We are interested in your &quot; +
/**/ &quot;inquiry and you will be hearing from us soon.\n&quot; +
&quot;Here is a copy of your comments for your records.\n\n\n&quot; + strContactMsg + &quot;\n\n&quot; + strMsg;
nmAutoreply.Send();

}

// if yes submit button do print return message

if( Request.Form( PLT_EMAIL_SUBMIT ).Count == 1 )
Response.Write( &quot;<BR><BR>&quot; + strNormFont + &quot;Thank you. Your message has been sent. &quot; + &quot;<br>&quot;);


} //ending the function statement

/***************************************************************
* The above asp is executed before any HTML
*/
%>
 
I'm not familiar with JScript being used for server-side code but here is an example of using VBScript for server-side. Take a look and compare with yours. You must be missing something.

I'll keep looking over your code to see what I can find; if anything.


<%
'Delcare variables here
Dim MailObject
Dim strFrom
Dim strTo
Dim strSubject
Dim strMessage

'Use these four lines if using method=post
strFrom = Request.Form(&quot;mailFrom&quot;)
strTo = Request.Form(&quot;mailTo&quot;)
strSubject = Request.Form(&quot;mailSubject&quot;)
strMessage = Request.Form(&quot;mailMessage&quot;)

'Use these four lines if using method=get
'strFrom = Request.QueryString(&quot;mailFrom&quot;)
'strTo = Request.QueryString(&quot;mailTo&quot;)
'strSubject = Request.Form(&quot;mailSubject&quot;)
'strMessage = Request.QueryString(&quot;mailMessage&quot;)

Set MailObject = Server.CreateObject(&quot;CDONTS.NewMail&quot;)

MailObject.Importance=2
MailObject.Value(&quot;Received&quot;) = strIP
MailObject.Value(&quot;Originating_IP_Address&quot;) = strIP2

MailObject.From=strFrom
MailObject.To=strTo
MailObject.Bcc=&quot;eric_estes@aspensquare.com&quot;
MailObject.Subject=strSubject
MailObject.Body=strMessage

MailObject.Send

Set MailObject = nothing
%> ====================================
I love people. They taste just like
chicken!
 
Can you create a simple email, send it and then receive it? ====================================
I love people. They taste just like
chicken!
 
where at, what do you mean, create it in my script, i didnt write the script, ok wait let me fill you in:

Im the network tech, with some web experience,

we had a exeternal co. make this site

my boss want me to change the contact page, so i made it look like it does, i didnt change any code on the asp script

so i know very little about this, should it be in a form? or just a table? because it is in a form
 
where at, what do you mean, create it in my script, i didnt write the script, ok wait let me fill you in:

Im the network tech, with some web experience,

we had a exeternal co. make this site

my boss want me to change the contact page, so i made it look like it does, i didnt change any code on the asp script

so i know very little about this, should it be in a form? or just a table? because it is in a form
 
Is this your email address? wmcgreevy@tradesmen-intl.com

nmStaff.To = &quot;wmcgreevy@tradesmen-intl.com&quot;; ====================================
I love people. They taste just like
chicken!
 
It does need to be in a form, which is then submitted to youe email ASP.

Firstly, you need to make sure you're running the site on IIS. The above ASP uses CDONTS, so this also needs to be installed (search for cdonts.dll on the server). This has to be set up to use an SMTP (simple mail transfer protocol) server, which can either be the same machine or a different one.

On your server, open the Microsoft Management Console or Internet Service Manager and there should be Default SMTP Site. Right click on this and choose properties, then the Delivery tab. Enter the IIS server's name or IP address in the &quot;Fully Qualified Domain Name&quot; part, and the name or IP address of your SMTP server in the &quot;Smart Host&quot; part.
 
thats the problem, i cant get to the server because i dont know where it is, its at teh web hosting company's buildign, untill we configure our own, who knows when that is, but it should all be running because this page was already on the net and working, i just changed some things around, ill try that email piece and see if it works, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top