|
I am running the script below on 1asphost.com but it is too slow and unrelible so I am going to move to a paid host.
What requirements do I need. Do i need mySQL? MSSQL? (what the difference anyway?)
I need to send an email from the script. See below. Do I need a certain requirement for that too? Can anyone recommend a good host that will meet my needs?
The script is: (I have removed some of the varibles for simplicity)
<% 'Dimension variables Dim adoCon 'Holds the Database Connection Object Dim rsAddComments 'Holds the recordset for the new record to be added Dim strSQL 'Holds the SQL query to query the database
'Create an ADO connection object Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("research.mdb")
'Create an ADO recordset object Set rsAddComments = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database strSQL = "SELECT * FROM tbdata;"
'Set the cursor type we are using so we can navigate through the recordset rsAddComments.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated rsAddComments.LockType = 3
'Open the recordset with the SQL query rsAddComments.Open strSQL, adoCon
'Tell the recordset we are adding a new record to it rsAddComments.AddNew
'Add a new record to the recordset rsAddComments.Fields("company") = Request.Form("company") rsAddComments.Fields("contact") = Request.Form("contact") rsAddComments.Fields("title") = Request.Form("title") rsAddComments.Fields("location") = Request.Form("location") rsAddComments.Fields("method") = Request.Form("method") rsAddComments.Fields("phone") = Request.Form("phone") rsAddComments.Fields("staff") = Request.Form("staff") rsAddComments.Fields("date") = Request.Form("date") rsAddComments.Fields("willing") = Request.Form("willing") rsAddComments.Fields("reason") = Request.Form("reason")
'Write the updated recordset to the database rsAddComments.Update
'Reset server objects rsAddComments.Close Set rsAddComments = Nothing Set adoCon = Nothing 'This will create the mail sending object. Set Mail = Server.CreateObject("Persits.MailSender")
'First you need to set the hostname of the mail server you want 'the mail object to use and who the mail is from. Mail.Host = "myhost" Mail.From = " mailto:ed@myemail.com - ed@myemail.com " 'The From part has the e-mail address. Mail.FromName = "Ed" 'The FromName is a user friendly name for the sender.
'Now you need to set the destination of the e-mail the address of who it is to. Mail.AddAddress " mailto:ed@myemail.com - ed@myemail.com , "Ed"
'Now you need to just give the actual message to send. Mail.Subject = "Solve Research Results" 'You need a subject Mail.Body = "Company = "+Request.Form("company")+", Contact = "+Request.Form("contact")+", Title = "+Request.Form("title")+", Location = "+Request.Form("location")+", Method = "+Request.Form("method")+", Phone = "+Request.Form("phone")+", Staff = "+Request.Form("staff")+", Date = "+Request.Form("date")+", Willing = "+Request.Form("willing")+", Reason = "+Request.Form("reason")
'Now you just need to send it... Mail.Send
'It is always good to check for errors, the MailSender object supports the Err object. If Err <> 0 Then Response.Write "Letter was not sent due to the following error: " & Err.Description else Response.Redirect "/thanks.htm" end if
%>
Many Thanks,
Ed
|