I have successfully in the past used this code to send HTML formatted emails from my ASP application. Recently the code is now inserting a </html> after each line it reads from the file. This is causing problems with email clients like Lotus Notes. It use to just read the file line by line and insert that into the body of an email message. Please help!! Here is the code:
If HTMLChk = "on" then
Mailer.ContentType = "text/html"
If oUpl.IsEmpty = False Then
NewFileName = Mid(oUpl.UserFilename, InstrRev(oUpl.UserFilename, "\" + 1)
oUpl.SaveAs NewFileName
FileName2 = oUpl.ServerName
SendMessage = ""
Dim fObj, f
Set fObj = Server.CreateObject("Scripting.FileSystemObject"
if fObj.FileExists(FileName2) then
Set f = fObj.OpenTextFile(FileName2,1,FALSE,FALSE)
Do until f.AtEndOfStream = True
SendMessage = SendMessage & f.ReadLine & "</html>" & vbCrLf
Loop
end if
Set fOBj = nothing
End If
If HTMLChk = "on" then
Mailer.ContentType = "text/html"
If oUpl.IsEmpty = False Then
NewFileName = Mid(oUpl.UserFilename, InstrRev(oUpl.UserFilename, "\" + 1)
oUpl.SaveAs NewFileName
FileName2 = oUpl.ServerName
SendMessage = ""
Dim fObj, f
Set fObj = Server.CreateObject("Scripting.FileSystemObject"
if fObj.FileExists(FileName2) then
Set f = fObj.OpenTextFile(FileName2,1,FALSE,FALSE)
Do until f.AtEndOfStream = True
SendMessage = SendMessage & f.ReadLine & "</html>" & vbCrLf
Loop
end if
Set fOBj = nothing
End If