Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm having some trouble with setting up a SMTP server on a windows server 2003 machine, while trying to send emails using PHP through the internet, but to domain email addresses.

Common info:

  • Machine has Windows Server 2003 Server
  • Machine on a domain (mydomain.com)
  • Machine is not a domain controller
  • Machine accesses a domain controller through the internet (WAN with a corporate VPN link by the internet provider setup on the machine's gateway - adsl modem/router)
  • Email addresses use the same suffix (mydomain.com)
  • Do not have access to domain controller configuration

First Scenario

  • TCP/IP DNS: 1st 192.168.200.xxx 2nd 8.8.8.8
  • Direct access to domain controller is functional
  • PHP mail using localhost to a user@mydomain.com won't work, because the remote mail server rejects emails from internal traffic (apparently!?!)

Second Scenario

  • TCP/IP DNS: 1st 8.8.8.8 2nd 192.168.200.xxx (switched)
  • Direct access to domain controller is not functional, only local accounts work
  • PHP mail using localhost to a user@mydomain.com does work, because the remote mail server is accessed through its internet/external address.

So, what I needed is to have both (1) access to the domain controller and (2) PHP mail using localhost to a user@mydomain.com account working.

Any pointers? Thanks in advance

share|improve this question

migrated from stackoverflow.com May 13 '12 at 18:35

This question came from our site for professional and enthusiast programmers.

    
Does the machine have a local MTA? Or does PHP have to make an outgoing connection to some other SMTP system for sending mail? –  sarnold May 13 '12 at 0:28
    
@sarnold I've setup a SMTP virtual server on this machine and I'm trying to send emails using that server. –  acseven May 13 '12 at 10:55

3 Answers 3

up vote 1 down vote accepted

I used hMailserver to route SMTP traffic to the email server I wanted, and disabled the IIS SMTP server.

Thanks for the input anyway

share|improve this answer

Since the DNS at 192.168.200.xxx is local, it probably resolves host names to local (192.168.200.xxx) IP addresses. The DNS at 8.8.8.8 is external, so it resolves host names to their FQDN.

The best solution is to have your outbound mail server rewrite the senders' addresses to use the FQDN instead of the local host/network names.

share|improve this answer
    
Hi! Thanks for the reply. The first part is what I understood so far. I really have no idea on how you to that address "rewrite" or whats FQDN... Can you give something more specific? Thanks –  acseven May 13 '12 at 0:22

I might have completely misunderstood what you are saying, but I would suggest setting the smtp host settings in php.ini to your ISP smtp server like so;

; http://www.php.net/manual/en/mail.configuration.php#ini.smtp
SMTP = your-smtp-server.yourisp.com

Then php in scenario 1) php will send email externally, and not be confused by the AD domain with the same name as the MX record for user@mydomain.com

share|improve this answer
    
I think this will send emails using that external SMTP server. Even though I could use this in another way, I am actually trying to send email using this machine (localhost), which is not getting accepted by the receiver server –  acseven May 13 '12 at 12:44
    
oh, then paste the bounce message and we can tell you what needs to change –  Tom H May 13 '12 at 21:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.