Hi all,
I have a requirement to use ASP to read email messages and identify the HTML formatted messages. I wrote the following code to identify if a email message is in HTML format. Similar code works with ColdFusion but not with ASP. A part of my ASP code is as follows:
Set Mailer = Server.CreateObject("POP3svg.Mailer"
Mailer.RemoteHost = "mail.activeweb4u.com"
Mailer.UserName = "msgonlinedb@sunriseumc.com"
Mailer.Password = "msgonlinedb"
Mailer.OpenPop3
‘ First check if the body contains “<!DOCTYPE HTML”
HtmlMsg = InStr(1, Mailer.BodyText, "<!DOCTYPE HTML", 1)
Response.Write "HtmlMsg1 = " & HtmlMsg & "<BR>"
‘ If not check if it contains “<HTML”
If HtmlMsg = 0 Then
HtmlMsg = InStr(1, Mailer.BodyText, "<html", 1)
Response.Write "HtmlMsg2 = " & HtmlMsg & "<BR>"
If HtmlMsg = 0 Then
Response.Write "<HTML NOT found<BR>
Else
Response.Write "<HTML found<BR>"
End If
Else
Response.Write "<!DOCTYPE HTML Found<BR>"
End If
With ColdFusion reading the same HTML formatted message this same type of code finds the HTML tag but this ASP code never finds the HTML tag. Does the POP3svg.Mailer suppress the HTML tag so I cannot detect it or is there a problem with my code?
Thanks for any help uou can give.
Brian
I have a requirement to use ASP to read email messages and identify the HTML formatted messages. I wrote the following code to identify if a email message is in HTML format. Similar code works with ColdFusion but not with ASP. A part of my ASP code is as follows:
Set Mailer = Server.CreateObject("POP3svg.Mailer"
Mailer.RemoteHost = "mail.activeweb4u.com"
Mailer.UserName = "msgonlinedb@sunriseumc.com"
Mailer.Password = "msgonlinedb"
Mailer.OpenPop3
‘ First check if the body contains “<!DOCTYPE HTML”
HtmlMsg = InStr(1, Mailer.BodyText, "<!DOCTYPE HTML", 1)
Response.Write "HtmlMsg1 = " & HtmlMsg & "<BR>"
‘ If not check if it contains “<HTML”
If HtmlMsg = 0 Then
HtmlMsg = InStr(1, Mailer.BodyText, "<html", 1)
Response.Write "HtmlMsg2 = " & HtmlMsg & "<BR>"
If HtmlMsg = 0 Then
Response.Write "<HTML NOT found<BR>
Else
Response.Write "<HTML found<BR>"
End If
Else
Response.Write "<!DOCTYPE HTML Found<BR>"
End If
With ColdFusion reading the same HTML formatted message this same type of code finds the HTML tag but this ASP code never finds the HTML tag. Does the POP3svg.Mailer suppress the HTML tag so I cannot detect it or is there a problem with my code?
Thanks for any help uou can give.
Brian