G
Guest
My office is using MDaemon as our email server. It's spam reporter requires that the spam email be forwarded as an attachment. I created an Outlook 2000 macro to create a new mail item, attach the selected mail item to the new mail item, send the new mail item to "(e-mail address removed)" and delete the selected mail item
The only problem I have is that MDaemon sends me back a reply saying
"Incorrect Message Format"... "The message(s) you submitted to the spam or ham learning system were not accepted. You must submit these messages to MDaemon as attachments of type message/rfc822. When using Outlook Express use the 'Forward as attachment' feature.
Here is the code I have
'############# Outlook 2000 Spam Reporting Macro #################
' Select the Mail Item you want to report to spam and run this cod
Public Sub SendToSpam(
Dim objOL As Outlook.Applicatio
Dim objSelection As Outlook.Selectio
Dim objMsg As Objec
Dim objNewMsg As Objec
On Error Resume Nex
' Instantiate an Outlook Application objec
Set objOL = CreateObject("Outlook.Application"
' Get the collection of selected object
Set objSelection = objOL.ActiveExplorer.Selectio
' This code sends the selected mail item
For Each objMsg In objSelectio
' This code only sends mail item
If objMsg.Class = olMail The
' Create a new mail Ite
Set objNewMsg = Application.CreateItem(olMailItem
' send the new mail item to the spam reporting email addres
objNewMsg.To = "(e-mail address removed)
'save the new mail before adding attachments for consistenc
objNewMsg.Sav
' add selected mail item as attachment to new mail ite
objNewMsg.Attachments.Add objMs
' send the new mail ite
objNewMsg.Sen
' Clear the New Mail Item objec
Set objNewMsg = Nothin
' Delete the spam mail ite
objMsg.Delet
End I
Nex
ExitSub
Set objMsg = Nothin
Set objSelection = Nothin
Set objOL = Nothin
End Su
'############# End of Outlook 2000 Spam Reporting Macro ##########
I have searched for five days to find a way to make this work (I'm usually quite proficient at finding things I am looking for)... any help would be appreciated!
I want to point out that the new mail item that is created with Automation looks just like a new mail item that I create WITHOUT Automation (by clicking the new mail button and then dragging the spam mail onto the new mail item and clicking send, which does not result in an MDaemon "Incorrect Message Format" reply.
I also tried [automation] saving the spam email item as a file and attaching the file to the new mail item. Which again functions correctly but I get the MDaemon reply still
I also tried changing the defaults on the add attachment method
objNewMsg.Attachments.Add objMsg, 1, 1, objMsg.Subjec
Please help me... this is driving me batty!
The only problem I have is that MDaemon sends me back a reply saying
"Incorrect Message Format"... "The message(s) you submitted to the spam or ham learning system were not accepted. You must submit these messages to MDaemon as attachments of type message/rfc822. When using Outlook Express use the 'Forward as attachment' feature.
Here is the code I have
'############# Outlook 2000 Spam Reporting Macro #################
' Select the Mail Item you want to report to spam and run this cod
Public Sub SendToSpam(
Dim objOL As Outlook.Applicatio
Dim objSelection As Outlook.Selectio
Dim objMsg As Objec
Dim objNewMsg As Objec
On Error Resume Nex
' Instantiate an Outlook Application objec
Set objOL = CreateObject("Outlook.Application"
' Get the collection of selected object
Set objSelection = objOL.ActiveExplorer.Selectio
' This code sends the selected mail item
For Each objMsg In objSelectio
' This code only sends mail item
If objMsg.Class = olMail The
' Create a new mail Ite
Set objNewMsg = Application.CreateItem(olMailItem
' send the new mail item to the spam reporting email addres
objNewMsg.To = "(e-mail address removed)
'save the new mail before adding attachments for consistenc
objNewMsg.Sav
' add selected mail item as attachment to new mail ite
objNewMsg.Attachments.Add objMs
' send the new mail ite
objNewMsg.Sen
' Clear the New Mail Item objec
Set objNewMsg = Nothin
' Delete the spam mail ite
objMsg.Delet
End I
Nex
ExitSub
Set objMsg = Nothin
Set objSelection = Nothin
Set objOL = Nothin
End Su
'############# End of Outlook 2000 Spam Reporting Macro ##########
I have searched for five days to find a way to make this work (I'm usually quite proficient at finding things I am looking for)... any help would be appreciated!
I want to point out that the new mail item that is created with Automation looks just like a new mail item that I create WITHOUT Automation (by clicking the new mail button and then dragging the spam mail onto the new mail item and clicking send, which does not result in an MDaemon "Incorrect Message Format" reply.
I also tried [automation] saving the spam email item as a file and attaching the file to the new mail item. Which again functions correctly but I get the MDaemon reply still
I also tried changing the defaults on the add attachment method
objNewMsg.Attachments.Add objMsg, 1, 1, objMsg.Subjec
Please help me... this is driving me batty!