Home | Advertising Info3 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, March 28, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: wsendmail.asp and easyspace A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
mikeyweb
Newbie
Newbie


Joined: July/14/2006
Online Status: Offline
Info: 1
Added: July/14/2006 at 8:40am | IP Logged Quote mikeyweb

Hello
 
I was wondering if you could possibly help me...
 
As you might have guessed I am not a programmer!
 
But I have been trying to set up a website for a friend using an earlier website that I owned, which had a reponse form written in asp and I had hoped that by altering the website and e-mail information I would be able to use the script for my friend's website.
 
The asp form which leads to my wsendmail.asp does not work.  The form is visible but the wsendmail.asp page cannot be displayed.
 
From my reading of things it would seem that the script (which dates back a few years) has CDONT(?)as a component and that this is not supported by easyspace.com (where the website is being hosted) as it is now considered to be a security threat.
 

Here's what they say:
 
Easyspace offers both Windows NT and Linux web servers.  The former will support ASP and Access while the latter are capable of supporting iASP with the iASP/CGI/PHP upgrade. This also provides database connectivity with the MySQL database service upgrade.  Conversion from Access/ASP to MySQL is a relatively easy process.  NT packages are more expensive than the basic Linux Gold package.  

iASP software details

Easyspace uses Instant ASP software from Halcyon software.  This enables Easyspace to support iASP on our Linux servers.

Easyspace has also disabled the CDONT function and the ability to upload to the hosting using iASP. This is because these functions are considered a security threat to our servers. Please consider using php or cgi to provide these functions for the site.

When using FileSystemObject you will need to ensure that your files are writable by iASP to do this you need to set writable permissions on the files or directories using FTP.

In WS_FTP this can be done by right clicking on the file/directory to be written to.

The Sever.MapPath function must also be used EG:
    Dim fs, f
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    set f=fs.OpenTextFile(Server.MapPath("testtext.txt"), 1)
    Response.Write(f.readall)
    f.Close
    set f=Nothing
    set fs=Nothing

 
The code I have been using is below - if some one could very kindly alter the "CDONT" to "CDO.Message" and put the "<br />" _ where the should be and anything else that you think might be necessary I would greatly apreciate it. 
 
Many thanks
 
 
Jonti Wilson
 


<%@ Language=VBScript %>
<%
dim strFail
dim strName
strName=Request.Form("Name")
strEadd=Request.Form("Email")
dim strMessage
strMessage = ""
dim objEMail
dim strSubject
strSubject = Request.QueryString("subject")
if strSubject = "" then
strSubject = "Your Memo To Us Web Response Form"
strMessage = strMessage & "Name: " & Request.Form("Name") & vbcrlf
strMessage = strMessage & "Address: " & Request.Form("address") & vbcrlf
strMessage = strMessage & "E-mail Address: " & Request.Form("Email") & vbcrlf
strMessage2 = "Submitted via your website at: " & time & " on " & date & "." & vbcrlf _
& "The following request for information has been received from your website" & strMessage
 Set objEmail = Server.CreateObject("SMTPsvg.Mailer")
  objEmail.FromName  = "mywebsite.co.uk"
  objEmail.FromAddress = "administrator@mywebsite.co.uk"
  objEmail.RemoteHost  = "smtp.easyspace.com"
  objEmail.Recipient  = "myemail@btconnect.com "           ;
  objEmail.Subject  = strSubject
  objEmail.BodyText  = strMessage        &n bsp;     
  if not objEmail.SendMail then
   strFail="Mailer error: " & objEmail.Response _
   & "<br>" & Replace(strMessage,vbcrlf,"<br>") _
   & "<br><a href='javascript:history.go(-1)'>Go back</a>"
   Response.Write(strFail)
  end if 
'   Set objEMail = CreateObject("CDONTS.NewMail")
'   objEmail.Cc = "administrator@mywebsite.co.uk"
'   objEMail.Send " administrator@mywebsite.co.uk","myemail@btconnect.com",strSu bject,strMessage 'strFrom, strTo, strSubject, strMessage
 
end if
Set objEMail = Nothing
 if Err.number <> 0 then
 Response.Write ("The following error occurred: " & Err.description )
 else
 bSent = true
 end if
 
if strEadd <> "" then
isAdd = true
 
  Set objEmail = Server.CreateObject("SMTPsvg.Mailer")
  objEmail.FromName  = "mywebsite.co.uk"
  objEmail.FromAddress = "administrator@mywebsite.co.uk"
  objEmail.RemoteHost  = "smtp.easyspace.com"
  objEmail.Recipient  = strEadd          ; 
  objEmail.Subject  = "Your Message To Me"
  objEmail.BodyText  = "Thank you for completing the online form."        
             
  if not objEmail.SendMail then
   strFail="Mailer error: " & objEmail.Response _
   & "<br>" & Replace(strMessage,vbcrlf,"<br>") _
   & "<br><a href='javascript:history.go(-1)'>Go back</a>"
   Response.Write(strFail)
  end if 
'  Set objEMail = CreateObject("CDONTS.NewMail")
'  objEMail.Send "administrator@mywebsite.co.uk",strEadd,"Message","Thank you for your message." 'strFrom, strTo, strSubject, strMessage
  Set objEMail = Nothing
 
 if Err.number <> 0 then
 Response.Write ("The following error occurred: " & Err.description )
 else
 bSent2 = true
 end if
 
Set objEmail = Server.CreateObject("SMTPsvg.Mailer")
  objEmail.FromName  = "mywebsite.co.uk"
  objEmail.FromAddress = "administrator@mywebsite.co.uk"
  objEmail.RemoteHost  = "smtp.easyspace.com"
  objEmail.Recipient  = "myemail@btconnect.com "           ;
  objEmail.Subject  = "Message from one of your Website"
  objEmail.BodyText  = "Thank you!  We have just received a message."        
             
  if not objEmail.SendMail then
   strFail="Mailer error: " & objEmail.Response _
   & "<br>" & Replace(strMessage,vbcrlf,"<br>") _
   & "<br><a href='javascript:history.go(-1)'>Go back</a>"
   Response.Write(strFail)
  end if 
'  Set objEMail = CreateObject("CDONTS.NewMail")
'  objEMail.Send "administrator@mywebsite.co.uk",strEadd,"Message","Thank you for your message." 'strFrom, strTo, strSubject, strMessage
  Set objEMail = Nothing
 
 if Err.number <> 0 then
 Response.Write ("The following error occurred: " & Err.description )
 else
 bSent2 = true
 end if
 
end if
'Response.redirect ("thanks.asp?name=" & strName)
%>
Back to Top View mikeyweb's Profile Search for other info by mikeyweb
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

PowerASP active server pages asp.net microsoft .net framework sdk learn asp what is asp tutorial learn asp.net CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com