Note that there are some explanatory texts on larger screens.

plurals
  1. PO.NET - Mail server doesn't send mail through SmtpClient.Send
    primarykey
    data
    text
    <p>I wrote a single console application (just a part of a site code, but it must work apart too, and it has the same fault result as inside the site) (C#):</p> <pre><code>MailMessage message = new MailMessage("login@ourDomenInPunycode", "toMail") { Subject = "Hello", Body = "Hello world" }; SmtpClient client = new SmtpClient(); client.Host = "ourIP"; client.Credentials = new System.Net.NetworkCredential("login@ourDomenInPunycode", "ourPassword"); client.Port = 25; client.UseDefaultCredentials = false; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.Send(message); </code></pre> <p>So, isn't to send e-mail should be trivial? But wherever I send mail from local machine through our mail server (just running this console application), the following exception appears:</p> <p>System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Relaying to denied (authentication required)</p> <p>If I change the "login@ourDomenInPunycode" data to my own mailbox (at gmail or something else - no matter), all works fine. It also not depend from "toMail" address.</p> <p>So, what could be wrong with our mail server? Any special settings? We use Windows Server 2008 virtualized inside another Windows Server 2008 and Kerio Connect 7 as mail server at virtual Windows Server 2008. All other mail programs like Outlook works well with sending e-mails from our mail server. </p> <p>All articles which I read in Internet about SmtpClient's settings have only these (above) trivial settings and code, nothing special.</p> <p><strong>UPDATE</strong></p> <p>I done some fixes in text above.</p> <p>Here is a part of log of our mail server when I tried to send mail through console application launched from the mail server virtual PC ("mail.ourDomen.local" related to "ourIP" above):</p> <pre><code>Task 215 handler BEGIN Task 215 handler starting SMTP server session begin; client connected from mail.ourDomen.local:49399 Sent SMTP greeting to mail.ourDomen.local:49399 Command EHLO OurMailServer Sent reply to EHLO: 250 mail.ourDomenInPunycode ... Command MAIL FROM:&lt;login@ourDomenInPunycode&gt; Sent reply to MAIL: 250 2.1.0 Sender &lt;login@ourDomenInPunycode&gt; ok Command RCPT TO:&lt;toMail&gt; Sent reply to RCPT: 550 5.7.1 Relaying to &lt;toMail&gt; denied Connection to SMTP server mail.ourDomen.local lost: connection closed by remote host. SMTP server session end Task 215 handler END </code></pre> <p>"Sent reply to RCPT: 550 5.7.1 Relaying to denied" - Why this happened?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload