SMTP email not sent in one server, but sent in another server - asp.net

I have a section of code that sends email from SMTP server.
The code is carried out webservice & smtp server value is picked up from web.config, while the code hosted on server1 works (send/receive emails), whereas the same code hosted in server2 doesn't send/receive email.
Can you tell your thoughts?
Thanks

This really belongs on ServerFault.com, and there isn't enough information to give you a definitive answer, but I can give you my thoughts on it (as asked).
Most likely, if the SMTP server is a different server than the one your app is hosted on, then probably there is some configuration that needs to be done on the SMTP server. Usually, the SMTP server needs to grant pass-through permissions on a per-user and/or per-server basis. So, most likely your situation is that the SMTP server has an "Allow pass-through" list that includes the server where your code works, and does not include the server where the email is NOT sent.
At least, this is usually the problem in our network...
If the SMTP server is on the same server as your app, of course, you'd want to check to ensure that SMTP is installed on both servers with the same configuration.
If this fails, look for errors... In your app code, or in the event log.. .If my guesses are wrong, you're going to need more info to go on.
Finally, here is a good resource for a coder, not necessarily for an Admin, but it may have info that will help you. http://systemnetmail.com/

first thing to check is the windows firewall and if there is an antivirus or third party firewall installed on the machine.
also check the event log for some useful information about the details of the error.

Related

How to test if ldap server is up or not?

How i can test if ldap server is working or not .One way to use to Apache directory Studio client any other way if we can check if ldap server is running or not ?
Please remember i cannot login server machine where ldap installed i have to test it from a client machine.Please let me know what all mechanism or client we can use test ldap connection ?
The best way to test whether any resource is available is simply to try to use it in the normal course of your application, and cope with the errors as they arise.
Otherwise you're trying to predict the future, among other things.
Monitoring tools such as Zabbix, InterMapper,SCOM etc can provide status health.
You could try watching port 389 on the server. That port can be and is often changed. So you will need to get it from the admin of the ldap server.

SMTP and A record

I am a front-end developer so the server stuff goes a bit over my head. Please excuse me if the question is dumb.
I am hosting a wordpress site on our server with contact form 7, but we only have a A-records for www pointing to our site. The email management for said domain is held by a third party.
How is contact form sending the emails to the admins? It is using our hosts SMTP service? I am asking because I am getting the emails on gmail, but the client is not receiving them on his service.
Thank you!
When your server is sending email without you configuring anything, the most likely cause is that it is using the server itself. For that, it does not need to "know" any DNS entries, as it just connects to localhost, which always points to the server itself.
When you receive the mail, and your client is not, this is most likely the result of a spam filter. Have you asked your client to check the spam folder?
The problem of - mainly - shared hosting servers is that they tend to end up on spam lists like that of spamhaus.org etc. which greatly enhances your risk to end up in the spam folder. If you control the server, you could request deblocking or even whitelisting your server, but before you do that, you should be certain that your server is not inadvertedly relaying mail because of a misconfiguation, vulnerability, or outright being hacked. Your applications or the server itself could be configured to use an external smtp server, but that's not something that's easily explained here. Maybe try on serverfault.com?

IIS SMTP some mails had been lost

I am using SMTP server built in to the IIS. Over website sends email via this SMTP server and unfortunately we had lost some emails. I looked in to the SMTP log and I could not read that log properly since I could not find any useful tool that can read this log file. It's very hard to understand this log file. If someone give a useful tool that can read IIS SMTP server log, it would be a great help.
I have few other questions too.
The status for the lost email is 250 in the log file, does this mean everything went OK.
Is this SMTP server reliable enough to handle big number of emails at same time?
If not what would be the best solution?
One solution to all of this would be to use a 3rd party mail server provider. Some good ones below:
http://www.aweber.com/
http://mailchimp.com/
http://www.constantcontact.com/index.jsp
They have API you can implement and use in your code to send e-mails through their SMTP.
If you're sending big number of emails at the same time, it is better to use these as your ISP may be blocking your outgoing e-mails since they're in big numbers. They do this to prevent spam and hacking.
Sorry that I couldn't help with the log but consider this information too.

SMTP, IIS7 and Windows Server 2008

I'm having trouble setting up SMTP to relay through a 3rd party server.
I'm new to Server 2008 so please bear with me.
I have found the SMTP server in IIS6 which is currently off, but is there one I need to use in IIS7? (IIS7 websites do have the SMTP icon so that 'role' must be installed).
I have used the IIS7 icon to set the remote name and credentials. Using a little test website to send an email to my hotmail account, it comes up saying
Mailbox unavailable. The server response was: 5.7.1 ... we do not relay
or occassionally it says
The remote name could not be resolved: 'The SMTP URL'
I can send using localhost but because that is effectivly spoofing the "from address" loads of them get bounced back!
Anyone got any ideas????
Don't worry, it turns out the people in control of the relay server gave us the wrong username and password, so it would never have worked!
Also, didn't need SMTP server in IIS6 either, so will remove it.
Good to hear you got it sorted. For posterity's sake, if you need to run a SMTP service in IIS7, you need to install the IIS6 "bits" which includes the IIS SMTP service.
One fun gotcha--service gets installed as a manual start for some reason, that was fun to troubleshoot at 3am after the 7th tequila shot.

ActiveDirectoryMembershipProvider "The specified domain or server could not be contacted."

I have an application that is using ActiveDirectoryMembershipProvider to grant access to users. The application is hosted on a non-domain machine, with a firewall between the application server and the domain controller.
We've opened the LDAP port to the DC on the inside network - yet no matter what we try, we end up with an error that says "The specified domain or server could not be contacted."
Does anyone have any suggestions on how I can resolve this? We've tried everything we can think of and just aren't getting anywhere.
My connection string is:
<add name="ADConnectionString"
connectionString="LDAP://10.5.3.7:389/DC=MyTestDomain,DC=local"/>
And my provider is:
<add name="ActiveDirectoryMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider"
connectionStringName="ADConnectionString"
attributeMapUsername="SAMAccountName"
connectionProtection="None"
connectionUsername="LdapUser"
connectionPassword="LdapPassword" />
The application is hosted on a non-domain machine, with a firewall between the application server and the domain controller.
Since you could query directly using an LDAP tool, that suggests that the firewall is open correctly. However, keep in mind that the ActiveDirectoryMembershipProvider is not using plain old LDAP, it's using Microsoft technologies. For example, if you set connectionProtection="Secure", ADMP will try using SSL and port 636, if that fails, it will use Microsoft's built-in IPSec signing (see this article for more details).
Anyway, this makes me wonder about a couple things:
Does the AD domain have an IPSec "required" policy which refuses connections from non-domain/non-configured computers? (Probably not, since you connected with plain LDAP, but it's worth investigating.)
Have you added the domain controller's NetBIOS name to your lmhosts file, and its DNS name to your hosts file? (Many protocols check that their target's reported name matches the name you tried to connect to.)
A lot of people have noted problems using ADMP between different domains, and the solution required that a one-way trust be created. Since it sounds like your client computer is not in a domain, you can't have that trust--unless either (a) it is a member of a different domain with a one-way trust or (b) it is a member of the same domain and thus client-server trust is implicit.
It seems like the solution is to open port 445.
Read this thread
We're not allowed to open so I guess I'm stuck.
You can use this two articles, may be solve your problem
www.ddj.com/windows/184406424
forums.asp.net/t/1408268.aspx
and check your firewalls
I had this error, and managed to fix it. There are multiple reasons that can lead to this, here is a to-do list to identify exect problem:
Create a micro application, with single method Membership.GetAllUsers(), execute on machine outside Active Directory (AD), with incorrect password in connection string, check if you get incorrect password exception. If you don't get it you can't connect to your AD server, check firewall, if you do get invalid password exception, goto next step.
If you can, try to execute same app, localy on AD server, first with incorrect password, than with correct, executing app locally provides more detailed exception what is wrong (for me this exception lead me to fixing problem). In my case it told me that Server service is not started, than that Workstation service is not started.
Some thoughts on the fact that it required Server and Workstation services to be working on server: afaik Server service is used for windows file sharing (netbios over TCP), and is using 445 port, so it mey be that this port must be opened in addition to LDAP port. My second observation was that event if 445 port opened (netstat -an) it still can be not working, winows will drop all packets to this port if Windows Client and File and Printer sharing checkboxes are not checked on network interface adapter which rcived this packets. Check "telnet External_IP 445". Thats all info i gathered while strugling with this problem.
Have you tested with an LDAP browsing tool, from the remote box to see if it can connect with the criteria being used here? I.e. Is it a connectivity problem or something else?
In case anyone stumbles on this and wants to smash their head on a wall... Recently tried doing all this for an AD server that my company had in a different domain than the current context. Was using the IP provided and getting failures as stated here. Even used a tool like Softerra LDAP Admin and it worked fine, however AccountManagement failed.
We had a publicly exposed URL hooked to that IP address (still only allowing certain IP's to make calls). Once I replaced the IP with the URL provided, it worked like a charm.
Hope this saves someone the hours of head smashing I just put myself through.

Resources