This is how I am trying 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 domain name to be localhost
and port number - 25
, all other settings I left in their default values.
When I am trying to send an email - it sends it successfully, however I cannot see this email, session logs also doesn't 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 wrong or please explain how I can find out whats happening with email I sent?