I am receiving the message "Mail Enabled Sub-domain check failed" when attempting to send emails via our internal SMTP server.
I am using the SMTP Client library in a VS2013 development environment. I've inherited the code and due to the confidential information contained in the actual configuration, unfortunately I am not at liberty to post it; but I can affirm that the settings for the SMTP Client are correct and I may be able to provide any additional information if it helps to answer the question as long as it doesn't require confidential data.
In past configurations, I have always authenticated directly to a specifically named SMTP server by providing the host and port information in the SMTPClient class instantiation.
This scenario is somewhat different because I've been informed that one of our other servers (A Web Server) where the application is running; is actually being passed as the SMTP Host for the SMTP Client connection.
But in actuality, I'd say it would technically be functioning as a Relay Server since it isn't an SMTP server.
Messages are submitted to our internal staff from the clients through a Popup Dialog that allows them to enter their message and click submit. The message gets sent to an internal email address and CC'd to the sender.
Upon debugging the program, no errors get thrown on the Send() method of the client.
I've tested this and the message must be hitting the SMTP server because I do get an email; however, instead of receiving the test message that I submit via the application; I get a message stating, "Delivery to the following recipients failed." with my email address in it and the email to where the message should be sent.
At the end of the message it says "Mail Enabled Sub-domain check failed"
I've searched online for this message but get no hits so it may be a message that is generated only within our organization; or maybe no one has posted the problem before.
In either case, can anyone provide any insight as to what this message likely means? I receive no errors in the System or Application event logs on the server. Maybe there are some other areas I need to check to make certain the Web server is properly configured to function as an SMTP relay server? I am unfamiliar with configuring a Web Server in this manner.
I'm at a loss for clues at this point.
I am posting this answer as it pertained to our particular situation. I'm fairly certain that the message may be somewhat of a blanket error; and so there may be other scenario's for which the error could be generated.
As previously stated, the SMTP host address that our application is using is actually the host address of the Web Server on which the application is running. The Web Server is also configured as an SMTP relay server, meaning any mail requests sent via the application uses the local host to relay the message to the actual SMTP Exchange Server.
After hours of troubleshooting to find the cause of the error it was identified that the Server Name was not in the correct format to leverage the SMTP Relay system.
For example, the host name that was used was in the format:
machinenameCNameAlias.subdomain.domain.com
when it should have been
actualMachineName.subdomain.domain.com
In other words, the use of a CNAME alias was not valid when using an SMTP Relay Server. (At least in our configuration)
Once the CNAME alias was replaced with the actual name of the server, the error was resolved.
I am obviously not an expert in any respect with the particulars of Exchange or it's Configuration counter parts; but after searching online with the keywords, "CNames and SMTP Relay Servers"; I did find other potential references; maybe inferring that CNAME aliases are discouraged with similar configuration types.
If anyone else can affirm these observations, that would be great.
But as for the particular scenario for which the question was initially posted, this was the answer for us.
Related
I'm developing an ASP.NET MVC application that needs to transmit sensitive information via email. I'm aware of using S/MIME to encrypt the email contents end-to-end, but I cannot use it for various reasons. I also realize, however, that the emails would be sent in plain-text from the web host's SMTP server to the destination email servers, opening up a serious man-in-the-middle vulnerability. Therefore, I need to ensure that the outgoing SMTP server will transmit a message ONLY IF it can establish a TLS/SSL connection with the destination mail server.
I've been searching for a while and can't even figure out where in the process that decision is made. Most answers address enforcing TLS between the application and the SMTP server, which I've already solved. Can anyone shed some light on this? Thanks.
What you are trying to do is not possible. Once you've submitted the mail to the mail server you've lost control over it. There is no way to instruct the server (and all following server in the path) to only deliver the mail with TLS.
I have an application that send email for my issues. I use SmtpClient class for this work.
It works fine with one of my mail servers but recently I use an exchange server for sending mail.
my SendEmail method throw an exception with this message:
550 Requested action not taken: mailbox unavailable / 5.7.1 Unable to
relay
Is this problem from my application or is it for mail server configuration?
What is the solution?
Well SMTP error 550 is generically (based on a little searching) define as something like:
550 Requested actions not taken as the mail box is unavailable.
This is likely an error at the destination. Eg. a disk drive has filled up.
In your case:
550 Requested action not taken: mailbox unavailable / 5.7.1 Unable to relay
The suffix indicates:
The email is not hosted on the SMTP server you're communicating with.
That SMTP server is refusing to forward to the final destination (or another relay).
There are many possible reasons for #2 (eg. an ISP's SMTP server will only relay when sending from inside the ISP's network) but finding out which would need to get into specifics (and it could be a temporary situation like loss of connectivity). Best to talk to the administrator/support for that server.
I am working on an ASP.NET website. I have a page where I'm sending mail. Here the user adds the recipient; the sender is his own id. When I run this application on my location machine the mail properly comes in my inbox but as I paste that page on the server and try mailing the mail comes in Junk folder.
Can somebody please help me out?
Check if your Sever IP is added in Relay list of SMTP server.
This doesn't sound like it has anything to do with code and more about setting your SMTP servers up properly in the realm of DNS and/or discussing it with your hosting provider. According to your post, your ability to send mail is not the issue - its more about how the receiving agent treats your email (tags it according to some rule, etc.). The only difference being "who" sends the email (your local machine, vs your server).
There are Postmaster resources - this one from everyone's favorite- AOL that you may find useful. You can also check with DNS blacklists if your server's IP is (unfortunately) listed.
Runtime exception is:
The transport failed to connect to the server
Please give me any of your suggestions.
As I am working on my own pc so i do not have any mail server so i put the name of my internet broadband provider (SmtpMail.SmtpServer = "smtp.virginmedia.com";) Is it the right way?
Make sure that the server accepts your connection.
The first step is to read the error message.
At a guess, I would say that this error is caused because the web application is unable to connect to a particular server. Then we go look up the documentation for SmptMail class to see what could cause that.
The first thing we see is that the System.Web.Mail API is obsolete and that you should use System.Net.Mail.SmtpClient instead.
It could be because
your smtp server name does not resolve
your smtp server ip or port is incorrect
your smtp server requires authentication
your smtp server requires ssl
You will need to check with your provider to see if they support SMTP and to get the correct server address. You might consider installing an SMTP server on your machine.
You might also want to try using an SMTP test tool. This is a quick and easy way to test different settings without having to deal with any other possible issues in your own code. There are a few good ones out there. I've used one before but I don't remember which one, sorry.
I'd recommend that you try using System.Net.Mail instead of SmtpMail, but that may not solve your connection problem.
Before you get too wrapped up in diagnosing connection problems in your project, make sure you can send a message using a standard email client like Outlook or Pine. Then copy your settings from the mail client into your code or into your web.config file to set the SMTP server connection.
If you are using a hosting service they likely have permissions fairly strict on the server.
In a lower trust mode on the server, all SMTP connections must be setup using web.config. If you try to pass a address inline in your code you violate trust conditions.
SMTPClient Half Working \ Half Not
As part of my app's config process, I have a sanity checker that validates all user-supplied data. This includes email server settings that the app uses to send email.
I'd like a simple sanity check on those settings without actually sending any email. It'd be great if this could support all standard flavors of SMTP setups including those with authentication/ssl/etc.
It doesn't need to be exhaustive but the more coverage, the better.
Currently all I do is verify I can open a connection to the given server on the given port. Something a little deeper would be nice.
Note: I'm not trying to validate email addresses--that's not relevant to this question.
You just open a raw connection to the server & port that the user supplies and do a
HELO Server.Domain.Com
Mail From: validaccount#domain.com
to see if you get a valid HELO response & Sender OK Response
(if smtp authentication is enabled).
Same as you would do if you telnet direct to the server.
http://www.petri.co.il/test_smtp_service.htm
This might also be useful
http://qmail.jms1.net/test-auth.shtml
I'm sure someone brighter and more qualified will pipe up with a better answer. However, at first blush I'd say that you cannot verify the ability to successfully send email without actually sending an email.
However, if you want to automate the process, you can have a 'MyApp_SanityCheck#gmail.com' (or your local domain) address.
Then you can create a watchdog application that monitors that email address, or just a simple app which programmatically interfaces with that email address and checks if an email was received within X minutes. This way you can be 100% certain that the emails are able to be sent out.
This link shows how to programmatically check gmail addresses.
An important note: If you application is sending out external emails, then it would be best if the email address you use is external, because it is possible that your server could be unable to send external emails, but internal emails go through just fine, and in that case your sanity check would send up a false positive.