objArray = Array ("email","assunto","texto")
For Each obj In objArray
strMessage = strMessage & obj & " : " & Request(obj) & "<br>"
Next
'################### Na época que eu usava asp ###################
'------ utilizava este código para envio -----------
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")= 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
objCDOSYSCon.Fields.update
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = email
objCDOSYSMail.To = "<" & destinatario & ">"
objCDOSYSMail.Subject = assunto
objCDOSYSMail.HtmlBody = "<p>" & strMessage & "</p>"
objCDOSYSMail.Send
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
'outros scripts de envio de email podem ser vistos no link abaixo
'https://www.baboo.com.br/tutorial/tutorial-software/envio-de-e-mail-com-asp/
'#################################################################
if err.number <> 0 then
response.write "Problemas no envio, por favor tente mais tarde."
else
response.redirect("index.html")
end if
Cdosys - Authenticated Email Submission - source
<%
objArray = Array ("email","assunto","texto")
For Each obj In objArray
strMessage = strMessage & obj & " : " & Request.Form(obj) & "<br>"
Next
'CRIA A INSTANCIA COM O OBJETO CDOSYS
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
'CRIA A INSTANCIA DO OBJETO PARA CONFIGURAÇÃO DO SMTP
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'SERVIDOR DE SMTP
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.seudominio"
'PORTA PARA COMUNICAÇÃO COM O SERVIÇO DE SMTP
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
'Utilização de SSl
'objCDOSYSCon.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'ATIVAR RECURSO DE SMTP AUTENTICADO
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'USU?RIO PARA SMTP AUTENTICADO
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
'SENHA DO USUÁRIO PARA SMTP AUTENTICADO
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "senha"
'TEMPO DE TIMEOUT (EM SEGUNDOS)
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
'ATUALIZA A CONFIGURAÇÃO DO CDOSYS PARA ENVIO DO E-MAIL
objCDOSYSCon.Fields.update
Set objCDOSYSMail.Configuration = objCDOSYSCon
'NOME DO REMETENTE, E-MAIL DO REMETENTE
objCDOSYSMail.From = "Remetente <[email protected]>"
'NOME DO DESINATARIO, E-MAIL DO DESINATÁRIO
objCDOSYSMail.To = "NOME <[email protected]>"
'objCDOSYSMail.cc = "Copia <[email protected]>"
'objCDOSYSMail.bcc = "Copia Oculta <[email protected]>"
'ASSUNTO DA MENSAGEM
objCDOSYSMail.Subject = " Envio autenticado - CDOSYS Apps"
'CONTEUDO DA MENSAGEM
objCDOSYSMail.TextBody = strMessage
'PARA ENVIO DA MENSAGEM NO FORMATO HTML, ALTERE O TextBody PARA HtmlBody
'objCDOSYSMail.HtmlBody = "<html> <head><meta http-equiv=""Content-Type"" content=""text/html;charset=utf-8""></head><body></body></html>"
'ENVIA A MENSAGEM
objCDOSYSMail.Send
'DESTROI OS OBJETOS
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
response.write "Email enviado com sucesso"
'Response.Redirect "index.html"
%>
@I understand that you must be seeing things :D
– user60252
Besides, I didn’t know request(obj), it would have to be request("obj")
– Sam
the request would not be to pick up a form?
– Sam
There is no functional example, my server does not run Asp, but at the time I used Asp was that same
– user60252
good, I don’t want to disturb your code, but I use request only to get sent form value, request type("name")
– Sam
request(variable) I didn’t know
– Sam
but if that’s what it is, it’s news to me... I just wanted to emphasize that request.form is outdated
– Sam
@I read this code at the time who provided me was the staff of the server
– user60252
I work with Asp 11 years ago and only used request to get form post
– Sam
Let’s go continue this discussion in chat.
– Sam