contact.asp (Full Version)

All Forums >> [Web Development] >> ASP, PHP, and Database



Message


mjmtravel -> contact.asp (12/28/2008 16:50:15)

I'm running a flash site with form results that I want to email to myself. Flash uses a contact.asp script file to do the dirty work for the form. I'm trying to make this form send the email on godaddy.com and its not working. Can anyone see where I'm going wrong. I'm supposed to change the italics?
This is supposidely their sample code.

<%
from = request.form("from")
body = request.form("body")
subject = request.form("subject")
%>

<%
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = from
objMail.Subject = subject
objMail.To = "test@sostampa.net"
objMail.Subject = "Reservation Update"

Dim myMail
Set myMail = CreateObject("CDONTS.NewMail")

myBody = ""
myBody = myBody & "customer: " & request("customer") & vbcrlf
myBody = myBody & "phone: " & request("phone") & vbcrlf
myBody = myBody & "email: " & request("email") & vbcrlf
myBody = myBody & "data: " & request("data") & vbcrlf
myBody = myBody & "arrivaldate: " & request("arrivaldate") & vbcrlf
myBody = myBody & "arrivaltime: " & request("arrivaltime") & vbcrlf
myBody = myBody & "arrivalflightship: " & request("arrivalflightship") & vbcrlf
myBody = myBody & "departdate: " & request("departdate") & vbcrlf
myBody = myBody & "departtime: " & request("departtime") & vbcrlf
myBody = myBody & "departflightship: " & request("departflightship") & vbcrlf
myBody = myBody & "destination: " & vbcrlf & request("destination")

Set objMail = Nothing
Response.redirect "thankyou.html" '<- auto-redirection
'You must always do this with CDONTS.
'Change the page name to one that exists on your site.
%>




Spooky -> RE: contact.asp (12/28/2008 18:56:37)

Does godaddy still support CDONTS? Do they have a CDOSYS script as well?




mjmtravel -> RE: contact.asp (12/28/2008 21:32:51)

They do use that as well but don't give any examples of that code. Plus now they say to put a relay-hosting.secureserver.net in the code somewhere. They won't tell me where it should go either.
Any help would be great. Glad to see you back spooky!




Spooky -> RE: contact.asp (12/28/2008 22:19:39)

Sort of back ;-)

Try something like this?

<%
Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "relay-hosting.secureserver.net"
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To 		= "webmaster@xyz.com"
oMail.From 		= from
oMail.Subject 		= subject 
oMail.TextBody 		= MyBody
oMail.Send
Set iConf = Nothing
Set Flds = Nothing
%>




mjmtravel -> RE: contact.asp (12/29/2008 11:48:52)

Spooky it took some twisting of your code but now I get the email message with this code. I still cannot get my results to show up. Do I add mybody code above to get the form results to show up where the bold print is? Example: (myMail.TextBody="mybody=" then the rest of the fields?

Thanks again.


<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="xxx@xxxx.com"
myMail.To="xxx@xxxx.com"
myMail.TextBody="This is a message."
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="relay-hosting.secureserver.net"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>




Spooky -> RE: contact.asp (12/30/2008 14:25:13)

Pretty much the same as before?
Just make sure the value is set before using it

myBody = ""
myBody = myBody & "customer: " & request("customer") & vbcrlf
myBody = myBody & "phone: " & request("phone") & vbcrlf
myBody = myBody & "email: " & request("email") & vbcrlf
myBody = myBody & "data: " & request("data") & vbcrlf
myBody = myBody & "arrivaldate: " & request("arrivaldate") & vbcrlf
myBody = myBody & "arrivaltime: " & request("arrivaltime") & vbcrlf
myBody = myBody & "arrivalflightship: " & request("arrivalflightship") & vbcrlf
myBody = myBody & "departdate: " & request("departdate") & vbcrlf
myBody = myBody & "departtime: " & request("departtime") & vbcrlf
myBody = myBody & "departflightship: " & request("departflightship") & vbcrlf
myBody = myBody & "destination: " & vbcrlf & request("destination") 

myMail.TextBody=MyBody




mjmtravel -> RE: contact.asp (12/31/2008 20:54:55)

Spooky
I'm really close. I'm now getting everything in the email except the results of the request of each field. I get name of the field but no results with it.
Should I try something more like this.
myBody = ""
myBody = myBody & "customer: " Request.Querystring ("customer") & vbcrlf ???

Thanks for the responses.




William Lee -> RE: contact.asp (12/31/2008 22:42:50)

quote:

Should I try something more like this.
myBody = ""
myBody = myBody & "customer: " Request.Querystring ("customer") & vbcrlf ???


You should just go ahead and try. Try also Request.Form("customer"), then post back whether they work or not.

Are your formfields named accordingly as is stated in the arguments of the request object?




mjmtravel -> RE: contact.asp (1/1/2009 9:11:44)

Ok I just tried both variations with no luck. I have to be missing something small?




William Lee -> RE: contact.asp (1/1/2009 9:59:33)


quote:

ORIGINAL: mjmtravel

Ok I just tried both variations with no luck. I have to be missing something small?


Post your URL and the asp code again, everything in the mail script.




mjmtravel -> RE: contact.asp (1/1/2009 10:28:19)

William
Its actually a flash site, but it uses a .asp form, then .asp form script to send the email.
www.sostampa.net

Here is what I have. The flash form uses a GET value to send info to the contact.asp page. I know this is not Front page stuff, but it still uses regular ASP script. If I'm out of bounds here please let me know.

Thanks.

on (release) {
_parent.getURL("contact.asp","_blank","GET");
_parent.customer="Customer:";
_parent.phone="Phone:";
_parent.email="Email:";
_parent.Data="Data:";
_parent.arrivaldate="ArrivalDate:";
_parent.arrivaltime="ArrivalTime:";
_parent.arrivalflightship="ArrivalFlightShip:";
_parent.departdate="DepartDate:";
_parent.departtime="DepartTime:";
_parent.departflightship="DepartFlightShip:";
_parent.destination="Destination:";

}

contact.asp

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="test@sostampa.net"
myMail.To="test@sostampa.net"

myBody = ""
myBody = myBody & "customer: " & Request.Form ("Customer") & vbcrlf
myBody = myBody & "phone: " & Request.Form("Phone") & vbcrlf
myBody = myBody & "email: " & Request.Form("Email") & vbcrlf
myBody = myBody & "data: " & request("Data") & vbcrlf
myBody = myBody & "arrivaldate: " & request("ArrivalDate") & vbcrlf
myBody = myBody & "arrivaltime: " & request("ArrivalTime") & vbcrlf
myBody = myBody & "arrivalflightship: " & request("ArrivalFlightShip") & vbcrlf
myBody = myBody & "departdate: " & request("DepartDate") & vbcrlf
myBody = myBody & "departtime: " & request("DepartTime") & vbcrlf
myBody = myBody & "departflightship: " & request("DepartFlightShip") & vbcrlf
myBody = myBody & "destination: " & vbcrlf & request("Destination")

myMail.TextBody=MyBody
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="relay-hosting.secureserver.net"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>




William Lee -> RE: contact.asp (1/1/2009 10:48:11)

quote:

on (release) {
_parent.getURL("contact.asp","_blank","GET");
_parent.customer="Customer:";
_parent.phone="Phone:";
_parent.email="Email:";
_parent.Data="Data:";
_parent.arrivaldate="ArrivalDate:";
_parent.arrivaltime="ArrivalTime:";
_parent.arrivalflightship="ArrivalFlightShip:";
_parent.departdate="DepartDate:";
_parent.departtime="DepartTime:";
_parent.departflightship="DepartFlightShip:";
_parent.destination="Destination:";

}


What are all these?
Which is the name of the customer textbox - "customer" or "Customer:" ?


Amend the following according to your answer to the second questionl

quote:


contact.asp

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="test@sostampa.net"
myMail.To="test@sostampa.net"

myBody = ""
myBody = myBody & "customer: " & Request.Form ("Customer") & vbcrlf
myBody = myBody & "phone: " & Request.Form("Phone") & vbcrlf
myBody = myBody & "email: " & Request.Form("Email") & vbcrlf
myBody = myBody & "data: " & request("Data") & vbcrlf
myBody = myBody & "arrivaldate: " & request("ArrivalDate") & vbcrlf
myBody = myBody & "arrivaltime: " & request("ArrivalTime") & vbcrlf
myBody = myBody & "arrivalflightship: " & request("ArrivalFlightShip") & vbcrlf
myBody = myBody & "departdate: " & request("DepartDate") & vbcrlf
myBody = myBody & "departtime: " & request("DepartTime") & vbcrlf
myBody = myBody & "departflightship: " & request("DepartFlightShip") & vbcrlf
myBody = myBody & "destination: " & vbcrlf & request("Destination")

myMail.TextBody=MyBody
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="relay-hosting.secureserver.net"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>




mjmtravel -> RE: contact.asp (1/1/2009 12:21:02)

William

The first part of that code is in flash and the "Customer" is actually the variable in the form.

I did changed everything to small case just to make sure that was not the problem, but no luck.

quote:

_parent.customer="Customer:";


Thanks again




Spooky -> RE: contact.asp (1/1/2009 18:16:53)

So what is the result when you do this?

myBody = myBody & "departtime: " & request("DepartTime") & vbcrlf
myBody = myBody & "departflightship: " & request("DepartFlightShip") & vbcrlf
myBody = myBody & "destination: " & vbcrlf & request("Destination") 

response.write myBody 
response.end
?




mjmtravel -> RE: contact.asp (1/1/2009 20:22:36)

Spooky
It will not send the email if I switch

myMail.TextBody=MyBody for

response.write myBody
response.end

Sorry, I tried it and no email, switched back and got the email again.




William Lee -> RE: contact.asp (1/1/2009 20:34:56)

quote:

_parent.customer="Customer:";

So, if I understand the flash form correctly, the above line tells me that you are assigning a default value of "Customer:" to a textbox, which is named customer

Yet, when I view the form on your website, there isn't any text on the textboxes.
What exactly does that line do?

The thing that Spooky asked you to do, is there any output written on contact.asp even though the mail is not sent?

What is the exact content that was sent in the mail when user click submit right now?




mjmtravel -> RE: contact.asp (1/1/2009 20:45:46)

The text boxes have fields that are in a movie clip that is why you see an empty text box, what you type in is the variable.

What Spooky said to do actually did send the email, it just took for ever but with no results. The only information that appears on the contact.asp page is the text box titles, just like I get in the email, but no results either way.




William Lee -> RE: contact.asp (1/1/2009 20:48:31)

Sorry for being thick, but I need to see the exact sample output. If you can, post them.




mjmtravel -> RE: contact.asp (1/1/2009 20:50:06)

You mean what I get in the email?




William Lee -> RE: contact.asp (1/1/2009 20:52:22)


quote:

ORIGINAL: mjmtravel

You mean what I get in the email?

... as well as what's on contact.asp with the things Spooky asked you to do. Its for collateral troubleshooting




mjmtravel -> RE: contact.asp (1/1/2009 21:05:31)

Here is my exact contact.asp page. Below is the email I receive. If you go to the website and click on online reservations, that is the form I'm working on. Hit submit and you can see the contact.asp page which I will switch to a thank you page when I get it working.

Thanks again guys.

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="test@sostampa.net"
myMail.To="test@sostampa.net"

myBody = ""
myBody = myBody & "customer: " & Request.Form ("customer") & vbcrlf
myBody = myBody & "phone: " & Request.Form("phone") & vbcrlf
myBody = myBody & "email: " & Request.Form("email") & vbcrlf
myBody = myBody & "data: " & request("data") & vbcrlf
myBody = myBody & "arrivaldate: " & request("arrivaldate") & vbcrlf
myBody = myBody & "arrivaltime: " & request("arrivaltime") & vbcrlf
myBody = myBody & "arrivalflightship: " & request("arrivalflightship") & vbcrlf
myBody = myBody & "departdate: " & request("departdate") & vbcrlf
myBody = myBody & "departtime: " & request("departtime") & vbcrlf
myBody = myBody & "departflightship: " & request("departflightship") & vbcrlf
myBody = myBody & "destination: " & vbcrlf & request("destination")

response.write myBody
response.end
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="relay-hosting.secureserver.net"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=25
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>

This is a copy of the email I get

Sending email with CDOþ
From: test@email.net
Sent: Thu 1/01/09 8:36 PM
To: test@sostampa.net

customer:
phone: email:
data:
arrivaldate:
arrivaltime:
arrivalflightship:
departdate:
departtime:
departflightship:
destination:




William Lee -> RE: contact.asp (1/1/2009 21:27:52)

quote:

http://www.sostampa.net/contact.asp?t1=&t2=&t3=&t4=&t5=&t6=&t7=&t8=&t9=&Customer=wlee&Phone=1234&Email=wlee%401234%2Ecom&ArrivalDate=02012009&ArrivalTime=1000&ArrivalFlightShip=titanic&DepartDate=06012009&DepartTime=1200&DepartFlightShip=discovery&Destination=bangkok


this is the urlstring being passed to contact.asp.
If you're not getting the data in your email, change the Request("customer") to Request("Customer") or Request.Querystring("Customer")




mjmtravel -> RE: contact.asp (1/1/2009 21:34:34)

William
I tried that farther up the forum, but not sure whether I used the Capital in the variable. I'll try that.
Also in some of the emails I received from your test, some of them had results showing up. Did you just type them in on the contact.asp?




William Lee -> RE: contact.asp (1/1/2009 21:36:23)


quote:

ORIGINAL: mjmtravel

William
I tried that farther up the forum, but not sure whether I used the Capital in the variable. I'll try that.
Also in some of the emails I received from your test, some of them had results showing up. Did you just type them in on the contact.asp?


Yes I was the one that typed test data.





mjmtravel -> RE: contact.asp (1/1/2009 21:58:29)

William

I now have it set up like this with variables with Capitals, and MyBody at the bottom. I still show no results. I'll try Request.Querystring now.

myBody = myBody & "customer: " & Request.Form ("Customer") & vbcrlf

myMail.TextBody=MyBody




mjmtravel -> RE: contact.asp (1/1/2009 22:09:20)

William

Your a genuis. Request.Querystring with Capitals and MyBody at the bottom work finally.
The only thing I'm missing is the data from the drop down box but thats a Flash thing so I will figure that one out.

I can't thank you & Spooky enough for all your efforts.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.109375