Jump to content
Fórum Script Brasil
  • 0

Formulário Para Contato (cdosys)


fatto
 Share

Question

Olá, há uma semana estou tentando fazer um formulário para contato do usuário da minha página e não estou conseguindo.

Por favor me ajudem!!

Estou postando os códigos html e asp e o erro que está dando.

html

<form method="post" action="cdosys.asp">
Email address: <input type="text" name="email_address" /><br />
Question 1: <input type="text" name="question_1" /><br />
Question 2: <input type="text" name="question_2" /><br />
Question 3: <input type="text" name="question_3" /><br />
<input name="email_subject" type="hidden" value="Subject of
email" />
<input name="redirect_to" type="hidden" 
value="redirect_to.htm" />
<input type="reset" name="Reset" value="Reset" />
<input name="send" type="submit" value="Submit" />
</form>
asp
<%
For Field = 1 to Request.Form.Count - 3
FieldName = Replace(Request.Form.Key(Field),"_"," ")
FieldValue = Request.Form.Item(Field)
Body = Body & FieldName & ": " & FieldValue & VbCrLf
Next
'Dimension variables
Dim objCDOSYSCon
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Set and update fields properties
With objCDOSYSCon
'Outgoing SMTP server
.Fields
("http://schemas.microsoft.com/cdo/configuration/smtpserver")
 = "smtp.personalmoveisplanejados.com.br"
.Fields
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
 = 25
'CDO Port
.Fields
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Timeout
.Fields
("http://schemas.microsoft.com/cdo/configuration/smtpconnectionti
meout") = 30
.Fields.Update
End With
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
'Set and update email properties
With objCDOSYSMail'0=Low, 1=Normal, 2=High
.Fields("urn:schemas:httpmail:importance").Value = 1
'Who the e-mail is from
.From = Request.Form("email_address")
'Who the e-mail is sent to
.To = "[email protected]"
'Who the e-mail is CC'd to
.Cc = ""'The subject of the e-mail
.Subject = Request.Form("email_subject")
'Set the e-mail body format (HTMLBody=HTML TextBody=Plain)
.TextBody = Body
.Fields.Update
'Send the e-mail
.Send
End With
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
'Rederect after sending email
Response.Redirect Request.Form("redirect_to")
%>
erro
Microsoft VBScript compilation error '800a0400' 

Expected statement 

/cdosys.asp, line 16 

("http://schemas.microsoft.com/cdo/configuration/smtpserver")
^

Na linha 16 já mudei para smtpuser.igempresas.ig.com.br------ smtp.igempresas.ig.com.br----- localhost e nada deu certo

Desde já agradeço quem puder me ajudar.

Obrigado

Francisco

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Bareta, substituí pelo seu código mas está dando o seguinte erro:

CDO.Message.1 error '8004020d'

At least one of the From or Sender fields is required, and neither was found.

/cdosys.asp, line 39

Não sei configurar o formulário html para que seja compatível com o seu código.

Aguardo resposta.

Obrigado.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.6k
×
×
  • Create New...