Foros del Web » Programando para Internet » ASP Clásico »

Enviar coreo sin CDONTS

Estas en el tema de Enviar coreo sin CDONTS en el foro de ASP Clásico en Foros del Web. Estoy buscando un recomendar un amigo, para colocarlo en mi pagina pero sucede que no puedo colocarlo porque no soporta CDONTS mi servicio de Hosting ...
  #1 (permalink)  
Antiguo 09/02/2002, 02:59
Avatar de garcef  
Fecha de Ingreso: agosto-2001
Ubicación: Querétaro, México
Mensajes: 289
Antigüedad: 23 años, 8 meses
Puntos: 0
Enviar coreo sin CDONTS

Estoy buscando un recomendar un amigo, para colocarlo en mi pagina pero sucede que no puedo colocarlo porque no soporta CDONTS mi servicio de Hosting entonces encontre este Codigo

Formulario
<FORM METHOD=POST ACTION="SendArticle.asp">
<INPUT TYPE=HIDDEN NAME="URL"
VALUE="<%=Request.ServerVariables("HT TP_REFERER")%>">

Your Name: <INPUT TYPE=TEXT NAME=FromName>
<BR>
Your Email: <INPUT TYPE=TEXT NAME=FromEmail>
<BR>
What is the name of the person you are sending
this to? <INPUT TYPE=TEXT NAME=ToName>
<BR>
What is their email address?
<INPUT TYPE=TEXT NAME=ToEmail>
<P>
Your Message:
<TEXTAREA COLS=40 ROWS=5 NAME=Message></TEXTAREA>
<BR>
<INPUT TYPE=SUBMIT VALUE="Send the Article!"
</FORM>

Sendarticle.asp
Const forReading = 1
Dim objFSO, objOpenFile, strBody, iStart strLeft, strRight

Set objFSO = Server.CreateObject("Scripting.FileSystemObje ct")

'Get the refered URL
strLeft = Request("URL")

'Hack off the "http://"
strRight = Right(strLeft,Len(strLeft)-7)

'Find the first forward slash
iStart = instr(1,strRight,"/")

'Grab everything to the right of the forward slash
strRight = Right(strRight,Len(strRight)-iStart+1)

'Open the text file
Set objOpenFile = objFSO.OpenTextFile(Server.MapPath(strRight), _
ForReading)

'Read the contents of the text file into a string variable
strBody = objOpenFile.ReadAll

'We've got the contents of the file, so we can
'close the file and clean up
objOpenFile.Close
Set objOpenFile = Nothing

iStart = 1
iStop = 1

Do Until ((iStart = 0) or (iStop = 0))
iStart = instr(1,strBody,"<")
iStop = instr(1,strBody,">")
iLength = Len(strBody)
if Not ((iStart = 0) or (iStop = 0)) then
strLeft = Left(strBody,iStart-1)
strRight = Right(strBody,iLength-iStop)
strBody = strLeft & strRight
end if
Loop

---------------------
strBody = strNameFrom & " recommended the following at " & _
FormatDateTime(Now) & vbCrLf & _
String(50,"%") & vbCrLf & vbCrLf & strBody & vbCrLf & _
vbCrLf & String(50,"%") & vbCrLf & _
vbCrLf

Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")

objCDO.To = strTo
objCDO.From = strFrom

objCDO.Subject = "Read this Article!"
objCDO.Body = strBody

objCDO.Send

Set objCDO = Nothing

'At this point, you may want to print a thank you message, or
'redirect the user to some web page...

  #2 (permalink)  
Antiguo 09/02/2002, 03:01
Avatar de garcef  
Fecha de Ingreso: agosto-2001
Ubicación: Querétaro, México
Mensajes: 289
Antigüedad: 23 años, 8 meses
Puntos: 0
Re: Enviar coreo sin CDONTS

Ahora bien, que sucede si a partir de la ultima parte desde

--------------------------

coloco esto

Function SendEmail( sEmailServer, sFromEmail, sToEmail, sSubject, sText )
Dim objMail
set objMail = server.createobject("JMail.SMTPMail")
objMail.Sender = sFromEmail
objMail.ServerAddress = sEmailServer
objMail.AddRecipient = sToEmail
objMail.Subject = sSubject
objMail.Body = sText
if objMail.Execute then
SendEmail = ""
else
' Message send failure
SendEmail = objMail.Response
end if
Set objMail = nothing
End Function

Este es por Jmail, que si es soportado pero tambien utilizo el Bamboo
;)
  #3 (permalink)  
Antiguo 09/02/2002, 12:17
 
Fecha de Ingreso: enero-2002
Ubicación: Perez Zeledon Costa Rica
Mensajes: 1.009
Antigüedad: 23 años, 4 meses
Puntos: 11
Re: Enviar coreo sin CDONTS

Hola amigo Garcef, relamente no se que pasara en tu caso al hacer la variante que propones, nunca he usado eso, pero resulta que yo tengo el mismo problema que tu, necesito enviar mail, o formula, sin usar cdonts pues mi servidor no lo soporta, escribi la pregunta hace unos dias, puedes leer las respuestas que me dieron, quiza te sirva alguna Busca la pregunta
Enviar form sin cdonts... algo asi era, o busca por mi nickname rashid, y obtendras algo de ayuda extra.
A proposito me agradaria conocer si este codigo que propones con este cambio tuyo funciona, avisame por favor si te funciono.
Bay.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:47.