I have a really weird problem, I use AJAX to send an email from my html page, which links to a PHP page I have within the SAME website. The AJAX request works fine when I enter
I finally found the problem, I don't know how I didn't see due to my lack of experience with Servers and stuff. Long story short : I installed Wamp on the server, I used the IP+Port to access it, but when I use the DNS it directly points to the website files(including php files) and it didn't go through Wamp.
I ended up uninstalling Wamp and including PHP in my IIS server to directly compile PHP files without the need to install another server.
I followed this tutorial -> How to Install PHP on IIS 7 for Windows Server 2008