Forwarded messages
' The sub displays bodies of any forwarded messages ' within specified message (including messages within ' forwarded messages themsleves). Sub DisplayForwardedBody(objMsg) Dim objForwardedMsg, objAttach ' Forwarded messages reside in Attachments list For Each objAttach In objMsg.Attachments ' Does the attachment hold a message inside? If objAttach.IsMessage Then ' Load the forwarded message from the attachment Set objForwardedMsg = CreateObject("MailBee.Message") objForwardedMsg.RawBody = objAttach.Content ' Display the body of the forwarded message MsgBox objForwardedMsg.BodyText ' The forwared message may contain another ' forwarded messages. Thus we repeat the procedure ' for every message found in the root message. DisplayForwardedBody objForwardedMsg End If Next End Sub Dim objPOP3, objMsg ' Create POP3 object Set objPOP3 = CreateObject("MailBee.POP3") ' Unlock POP3 object objPOP3.LicenseKey = "put your license key here" ' Set POP3 server name objPOP3.ServerName = "mail.server.com" ' Set user credentials objPOP3.UserName = "username" objPOP3.Password = "password" ' Download a message Set objMsg = objPOP3.RetrieveSingleMessage(1) If Not objPOP3.IsError Then ' Display bodies of forwarded messages DisplayForwardedBody objMsg End If ' Disconnect if needed If objPOP3.Connected Then objPOP3.Disconnect End If
<% ' The sub displays bodies of any forwarded messages ' within specified message (including messages within ' forwarded messages themsleves). Sub DisplayForwardedBody(objMsg) Dim objForwardedMsg, objAttach ' Forwarded messages reside in Attachments list For Each objAttach In objMsg.Attachments ' Does the attachment hold a message inside? If objAttach.IsMessage Then ' Load the forwarded message from the attachment Set objForwardedMsg = Server.CreateObject("MailBee.Message") objForwardedMsg.RawBody = objAttach.Content ' Display the body of the forwarded message Response.Write objForwardedMsg.BodyText & "<br><br>" ' The forwared message may contain another ' forwarded messages. Thus we repeat the procedure ' for every message found in the root message. DisplayForwardedBody objForwardedMsg End If Next End Sub Dim objPOP3, objMsg ' Create POP3 object Set objPOP3 = Server.CreateObject("MailBee.POP3") ' Unlock POP3 object objPOP3.LicenseKey = "put your license key here" ' Set POP3 server name objPOP3.ServerName = "mail.server.com" ' Set user credentials objPOP3.UserName = "username" objPOP3.Password = "password" ' Download a message Set objMsg = objPOP3.RetrieveSingleMessage(1) If Not objPOP3.IsError Then ' Display bodies of forwarded messages DisplayForwardedBody objMsg End If ' Disconnect if needed If objPOP3.Connected Then objPOP3.Disconnect End If %>See Also: