I’m working for someone running a windows 2003 server. They want me to make a SMTP sink which can categorize what database and table we want to send messages to. They don’t have exchange on this server, only the default virtual SMTP server.
I’ve made a class, which I think should fire when the SMTP servers onarrival event occurs. I’m having an issue registering my class however, when I run RegAsm /regfile i’m getting a “Warning, RA0000: no registeration will occur, no types to register.” if I run RegAsm with /TLB it will tell me types were registered, but by class doesn’t show up in the global registery and my class isn’t called when mail is sent to the server. I’m a little at a loss as to what I’m doing wrong.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace SMTPSink
{
[Guid("????-????-?????-????")]
[ComVisible(true)]
[ProgId("SMTPSINK")]
public class SMTPSink : CDO.ISMTPOnArrival
{
SMTPSink()
{ }
void CDO.ISMTPOnArrival.OnArrival(CDO.Message Message, ref CDO.CdoEventStatus EStatus)
{
//Simple test to see if this fires on mail arrival
}
}
}
You forgot to make the constructor public. Required to export a coclass that doesn’t have the [noncreatable] type library attribute. Fix:
Or just omit it if it doesn’t do anything useful.