Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/02/2002, 02:59
Avatar de garcef
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...