26/10/2006, 14:43
|
| | Fecha de Ingreso: octubre-2004
Mensajes: 55
Antigüedad: 20 años, 3 meses Puntos: 0 | |
¿En qué estoy mal? El error mostrado es:
Código:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Se trata de una pag. ASP que estoy migrando a ASP.Net
El código es el siguiente:
Código:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" aspcompat=true%>
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<%
Dim oPOP3,oMsg,messageID,Sender,Subject,strSize,attachs,attachSize
Dim attachName,attachCID,strDate,BodyText,BodyHTML,tempFolder,virtualPath,HTML
Dim extName,contentid,count,i,name
oPOP3 = Server.CreateObject("FathMail.POP3")
oPOP3.ServerAddr = "RENDON"
oPOP3.Username = "[email protected]"
oPOP3.Password = "password"
oPOP3.Connect
if oPOP3.GetMessageCount Then
oMsg=oPOP3.Retrieve(17)'17
messageID=oPOP3.GetMessageID(17)'17
Sender = oMsg.Sender
Subject= trim(oMsg.Subject)
strSize=oMsg.GetSize
attachs=oMsg.GetAttachmentCount
attachSize=oMsg.GetAttachmentSize(0)
attachName=oMsg.GetAttachmentName(0)
attachCID=Replace(oMsg.GetAttachmentContentID(0),"<","")
attachCID=Replace(attachCID,">","")
strDate=oMsg.Date
BodyText = oMsg.Text
BodyHTML = oMsg.TextHTML
oMsg.SaveToFile("K:\www\Intranet\Temp\message.msg")
'==============================
count = oMsg.GetAttachmentCount
tempFolder="K:\www\Intranet\Temp"
virtualPath="/Intranet/Temp/"
If count > 0 Then
html = "<font face=""Courier New,Arial"" size=2>"
html = html & "<b>Attachments:</b> "
For i = 0 to count
'oMsg.SaveAttachment i,tempFolder
If oMsg.SaveAttachment( i,tempFolder & "\" & oMsg.GetAttachmentName(i).toString ) <> 0 Then
Response.Write( "Save attachment to " & tempFolder & " failed" )
Response.End()
End If
name = oMsg.GetAttachmentName(i)
extName = Right(name,3)
If LCase(extName) = ".gif" Or LCase(extName) = ".jpg" Then
contentid = oMsg.GetAttachmentContentID(i)
If contentid <> "" Then
bodyText = Replace( bodyText, "cid:" & contentid, virtualPath & name )
Else
bodyText = bodyText & "<hr><img src=""" & virtualPath & name & """>"
End If
End If
html = html & "<a href=""" & virtualPath & name & """ target=""_blank"">" & name & "</a> "
Next
html = html & "</font><br>"
End If
'==============================
oMsg = Nothing
End If
oPOP3.Disconnect
oPOP3=Nothing
%>
</body>
</html>
Agradezco de antemano su ayuda. |