Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7983005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:50:05+00:00 2026-06-04T10:50:05+00:00

I wrote a single console application (just a part of a site code, but

  • 0

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#):

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); 

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:

System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Relaying to denied (authentication required)

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.

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.

All articles which I read in Internet about SmtpClient’s settings have only these (above) trivial settings and code, nothing special.

UPDATE

I done some fixes in text above.

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):

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:<login@ourDomenInPunycode>
Sent reply to MAIL: 250 2.1.0 Sender <login@ourDomenInPunycode> ok
Command RCPT TO:<toMail>
Sent reply to RCPT: 550 5.7.1 Relaying to <toMail> denied
Connection to SMTP server mail.ourDomen.local lost: connection closed by remote host.
SMTP server session end
Task 215 handler END

“Sent reply to RCPT: 550 5.7.1 Relaying to denied” –
Why this happened?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:50:06+00:00Added an answer on June 4, 2026 at 10:50 am

    Well, we use this description

    https://kb.kerio.com/article/550-571-relaying-to-email%40addresscom-denied-authentication-required-411.html .

    Although we know about this settings, but we tangled with our virtual machines. We have a virtual machine for the web server and another one for the mail server. Permissions were configured for the mail server virtual machine only in the Kerio Connect, not for the web server. We just added permission for the virtual machine of the web server and the mail is sent normally.

    And the “ourIP” in the

    SmtpClient client = new SmtpClient();
    client.Host = "ourIP";
    

    is the IP of our virtual machine of the mail server. No settings of IP of the web server virtual machine in the SmtpClient object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like for a single console application to spawn other console windows and output
In my Visual Studio instance, even if I just wrote a single line of
i have written a simple console application just to try boost::thread, i am a
A while back I wrote a simple python program to brute-force the single solution
How can I read a single character/key from the console without having to hit
I wrote a python program which I call with arguments from console. As the
console.log takes an unspecified number of arguments and dumps their content in a single
I am trying to grab just a single value from some json and am
I have the following projects: MVC Console application Class library Windows forms application COM
I wrote a small Shotgun app, however, the section of code that needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.