Please i have a problem when I deploy my Server in docker
cedricnguemo3 opened this issue · 1 comments
indeed, when I launch my server in localhost I manage to intercept incoming emails. but when I expose this on docker I really have difficulty testing. and also I have trouble reading the content of my mail. thank you for helping me please.
When you use docker to launcher your server or worker process you need to EXPOSE the ports in your docker config. If you're using visual studio take a look at this: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/visual-studio-tools-for-docker?view=aspnetcore-7.0
You simply want to expose whatever endpoints you've got setup for your smtp config.
As far as reading emails, the server doesn't really 'read' emails for you. You must create your own MessageStore class and use it to persist those emails somewhere (DB, File, Etc) then write something that reads that.
For info on the MessageStore take a look at the example: https://github.com/cosullivan/SmtpServer/blob/master/Examples/SampleApp/SampleMessageStore.cs