Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot identify HTML formated email msgs using ASP

Status
Not open for further replies.

bcjweb

Programmer
Feb 29, 2000
2
US
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, &quot;<!DOCTYPE HTML&quot;, 1)
Response.Write &quot;HtmlMsg1 = &quot; &amp; HtmlMsg &amp; &quot;<BR>&quot;
‘ If not check if it contains “<HTML”

If HtmlMsg = 0 Then
HtmlMsg = InStr(1, Mailer.BodyText, &quot;<html&quot;, 1)
Response.Write &quot;HtmlMsg2 = &quot; &amp; HtmlMsg &amp; &quot;<BR>&quot;
If HtmlMsg = 0 Then
Response.Write &quot;<HTML NOT found<BR>
Else
Response.Write &quot;<HTML found<BR>&quot;
End If
Else
Response.Write &quot;<!DOCTYPE HTML Found<BR>&quot;
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


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top