Sending test emails during the development process without problems with spam or rejection

I am running the development environment in a virtual machine and should check the delivery and appearance of email messages from my applications. The problem is that my SMTP server starts delivering large mail to my corporate email account, so the server soon rejects as a spam source. Of course, major Internet email providers will also never accept email from such a server.

One solution to the problem: I delivered it to the file folder using the .NET SpecifiedPickupDirectory option and opened it in Outlook Express, but the problem is that VALID images always appear as broken images.

+4
source share
4 answers

Your answer: Papercut , an open source pseudo-SMTP test server. This is an email testing application for developers that needs to be run.

+6
source

You could make quite a few of your email scripts using unit tests and breadboard mail implementations. For example, you can create an interface for and a wrapper around the SmtpClient class. This shell should implement the interface. Use dependency injection to provide the dependent SmtpWrapper class (as an interface) to the class that uses it. In your unit tests, you can provide the layout of the interface instance to the class you are testing and make sure that it correctly sends the messages expected to the recipients you expect, given the test setup.

In the end, you will have to run some integration tests, but probably a lot less. In your integration tests, you can use your test SMTP server. Given that most of your tests run in unit testing with your mock implementation, this may be enough to prevent your corporate mail server from identifying your test server.

+2
source

To prevent your mail from being marked as spam, you need to talk to the system administrators who manage the corporate mail servers. They control how spam is flagged in the system and may be able to exclude your emails.

You mention a problem with broken images, but this has nothing to do with spam and may be better as a question about yourself (with the appropriate heading).

0
source

If you run Post Hoc, you can simulate sending any amount of email, but email never leaves your host. I run this in a virtual machine and the email stays in the virtual machine. No problem removing any spam restrictions. The number of addresses to which you send is not limited. He then offers a user interface for checking sent emails. Open source is available freely:

Git Hub at: Git Hub Site

Also see blog post: PostHoc: Testing Emailing Applications

0
source

Source: https://habr.com/ru/post/1305867/


All Articles