PDA

View Full Version : Invio di forms tipo submit


louione
02-18-2009, 11:55 AM
I am a beginner and I have a problem with a form type submit that I have in a first page in asp and on submit goes to a second page asp that write name,surname etc.The problem is thai I would like have that page posted to my email address.Is this possible and if it is,how can I do ?Thanks for help!!

abduraooft
02-18-2009, 12:05 PM
what? :eek:

brazenskies
02-18-2009, 12:47 PM
I think they want the submitted form information to be emailed them!

louione
02-18-2009, 01:25 PM
yes we would,but it is possible?And if it is how can i do?Thanks fo r help

Spudhead
02-18-2009, 03:29 PM
Yes it's possible. If you Google for "ASP CDOSYS (http://www.google.co.uk/search?q=ASP+CDOSYS)" you will find many, many useful examples.

louione
02-18-2009, 04:34 PM
Thank you,ill'do that and I let you know!!

louione
02-24-2009, 07:04 PM
I have tried few routines with Google but I don't understand when they say"your address" if they mean my real email address or the server's.I am using as testing server IIS of Microsoft.If I go on the property of IIS I have as SMTP predefinied server and as dominion"my computer name" and the address "C:\Inetpub\mailroot\drop".Is this the address I have to write?Because if it is,I alwais get error 0x800A000B(divide by zero).And also IIS is already configured or I have to do it?Thank fo r help!!

Old Pedant
02-25-2009, 12:18 AM
*** SHOW CODE ***

"Divide by zero" from that address surely means you forgot to put it in quotes, for example.

Anyway, when using CDOSYS, the word "address" almost surely refers to a VALID email address.

But show your code.

louione
02-25-2009, 06:34 PM
this is the code.I don't know how to fill the lines 55-57-59 and the 173 where error occurs.I have as testing server IIS of Microsoft and I don't know if the a

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%

'First lets Dim all the variables we need



Dim email

Dim name

Dim company

Dim telephone

Dim address1

Dim city

Dim state

Dim zip

Dim users

Dim app_name

Dim decision_time

Dim OS

Dim bandwidth

Dim DedicatedFirewall

Dim TapeBackup

Dim special_details

Dim MyBody

Dim MyMail

Dim MyEmail

Dim SmtpMail



'Now lets get some values for the variables from the form

smtpserver = "mail.pcfisso.com"

youremail = "To = pcfisso\C:\Inetpub\mailroot\Drop"

yourpassword = ""

email = Request.Form("email")

name = Request.Form("name")

company = Request.Form("company")

telephone = Request.Form("telephone")

address = Request.Form("address")

city = Request.Form("city")

state = Request.Form("state")

zip = Request.Form("zip")

users = Request.Form("users")

app_name = Request.Form("app_name")

decision_time = Request.Form("decision_time")

OS = Request.Form("OS")

bandwidth = Request.Form("bandwidth")

DedicatedFirewall = Request.Form("DedicatedFirewall")

TapeBackup = Request.Form("TapeBackup")

special_details = Request.Form("special_details")



'Now lets build the body of the email from the data in the form

MyBody = "<p><font face=Arial size=2>" & Chr(13) & vbcrlf

MyBody = MyBody & "Company: "& company & Chr(13) & vbcrlf & "<br>"

MyBody = MyBody & "Name: "& Name & Chr(13) & vbcrlf & "<br>"

MyBody = MyBody & "Email: "& email & vbcrlf & "<br>"

MyBody = MyBody & "Telephone: "& telephone & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Address: "& address & vbcrlf & "<br>"

MyBody = MyBody & "City: "& city & vbcrlf & "<br>"

MyBody = MyBody & "State: "& state & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Zip: "& zip & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Application: "& app_name & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Decision Timeframe: "& decision_time & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Operating System: "& OS & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Monthly Bandwidth Estimate: "& bandwidth & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Dedicated Firewall: "& DedicatedFirewall & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Tape Backup: "& TapeBackup & vbcrlf & vbcrlf & "<br>"

MyBody = MyBody & "Comments:" & vbcrlf & "<br>"

MyBody = MyBody & special_details



'Now lets put the variables and other information we need into the mailing script

Dim ObjSendMail

Set ObjSendMail = CreateObject("CDO.Message")



'This section provides the configuration information for the remote SMTP server.



ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network).

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtpserver

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False)

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60



ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = youremail

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = yourpassword



ObjSendMail.Configuration.Fields.Update



'End remote SMTP server configuration section==



ObjSendMail.To = pcfisso\paolo1

ObjSendMail.Subject = company

ObjSendMail.From = email



' we are sending a html email.. simply switch the comments around to send a text email instead

ObjSendMail.HTMLBody = MyBody

'ObjSendMail.TextBody = MyBody



ObjSendMail.Send



Set ObjSendMail = Nothing

%>

<font size="2">Your message as seen below has been sent. Thank You !!

<br><br>

<font color="blue">

<% =Replace(MyBody,vbCr,"<font face=Arial size=2>") %>

</font>

ddress means mine or server's.Thank for help!

abduraooft
02-26-2009, 07:06 AM
Hi louione, please edit your above post and add ][/COLOR] tags around your code.

Old Pedant
02-26-2009, 08:07 AM
Just for starters, this is completely wrong:

ObjSendMail.To = pcfisso\paolo1

That *WILL* produce a "DIVIDE BY ZERO" error, as you noted.

That *NEEDS* to be a LEGAL email address. In quotes. Or in a string variable.

Example:

ObjSendMail.To = "barack.obama@whitehouse.gov"


I also do NOT think that this part is right:

youremail = "To = pcfisso\C:\Inetpub\mailroot\Drop"

But I can't be sure about that.

Personally, I would recommend LEAVING OUT these 3 lines at first and only putting them back if you find you MUST have them:

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = youremail
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = yourpassword

louione
02-26-2009, 06:03 PM
Thanks for help .I will try and i'll let you know. OK I tried and it works! Thank you mate!

louione
02-27-2009, 05:21 PM
all ok.Thanks!!