How to receive emails using smtp4dev

This is how I try to send an email:

MailMessage mail = new MailMessage(); mail.From = new MailAddress(" test@test.com "); mail.To.Add(" test1@test.com "); mail.Subject = "Subject"; mail.Body = "Body"; SmtpClient smtp = new SmtpClient("localhost", 25); smtp.UseDefaultCredentials = true; smtp.Send(mail); 

In smtp4dev I configured the localhost domain name and the port number is 25 , all other settings that I left in their default values.

When I try to send an email - it sends it successfully, however I do not see this message, the session logs also do not say anything useful:

 220 localhost smtp4dev ready EHLO MobileVladimirs 250-Nice to meet you. 250-8BITMIME 250-STARTTLS 250-AUTH=CRAM-MD5 PLAIN LOGIN ANONYMOUS 250-AUTH CRAM-MD5 PLAIN LOGIN ANONYMOUS 250 SIZE MAIL FROM:< test@test.com > 250 Okey dokey RCPT TO:< test1@test.com > 250 Recipient accepted RSET 250 Rset completed 

Please tell me where I am mistaken, or explain how I can find out what happens with the email that I sent?

+5
source share
2 answers

Are you using a Norton 360 or the like? This program will interfere with port 25 as part of the anti-spam function.

For Norton 360, you will see port 25 specified in the "Settings" → "Antispam" → "Protected Ports" section, and it cannot be changed.

By changing the dev settings to port 26, I was able to get smtp4dev and papercut to work.

+3
source

check IIS smtp settings, it should not save emails on disk

-1
source

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


All Articles