Is there a way for using .net to create a console app. or service to listen for SMTP messages over a certain port?
I need to create a middle tier object that will capture and process smtp messages. That is to say i want smtp messages sent and picked up by this listener and then broken down to its basic components and persisted to a sql server DB.
If there is a off the shelf solution even better. I was not able to find one as I scurried the web.
Note: smtp sender will be a web app on the network, as well as exchange. The listener will be assigned some port so all smpt traffic on this port will be designated for my particular application.
C#ExchangeEmail Clients
Last Comment
kaufmed
8/22/2022 - Mon
kaufmed
Have you looked into the System.Net.Sockets.TcpListener class?
realcoding
ASKER
kaufmed:
i have not worked with this class yet. can you explain how this would help me?
Here's the actual standard from the IETF, note section 4.5.1 lists the minimum required to comply with the standard. You would probably need to meet those minimums to effectively work with commercial SMTP servers like Exchange. There are also other details you need to be aware of (like maximum length for a "MAIL FROM:<>" command, and encoding of periods in message data).
thanks all, i have got some serious reading to do. also ill try your POC app as well. thanks all for the great help !
kaufmed
NP. Glad to help = )
realcoding
ASKER
@kaufmed,
I have the consul apps made but my environment is preventing mail from going out and telling me the server actively refused the connection. do i need to config something aside from running the apps?
That usually means the server doesn't have that port open (i.e. the service isn't running). There could also be firewall or antivirus restrictions, I imagine. Can you confirm none of these is the case?