Rottingham Posted June 1, 2008 Share Posted June 1, 2008 Hello guys and gals! I've run into a new situation! I've recently completed a site: http://www.oreca.org The contact form no longer works. I switched their hosting platform and when I did, I did not know my customer had a server onsite that handled their email. I've removed the MX entrys on their hosting and turned it back over to their private server. Now however, the contact sendmail fails because it doesn't have the ability to send mail, as it doesn't host the mail server! Any idea what I should do? Link to comment https://forums.phpfreaks.com/topic/108203-sendmail-from-website-that-doesnt-host-the-mail-server/ Share on other sites More sharing options...
radar Posted June 1, 2008 Share Posted June 1, 2008 well knowing how you have it set to send mail now would be helpful... There are several different ways... Link to comment https://forums.phpfreaks.com/topic/108203-sendmail-from-website-that-doesnt-host-the-mail-server/#findComment-554629 Share on other sites More sharing options...
Rottingham Posted June 3, 2008 Author Share Posted June 3, 2008 Just using the standard sendmail() on the server. I don't know any better way to explain it. It sends through an email on the account. Link to comment https://forums.phpfreaks.com/topic/108203-sendmail-from-website-that-doesnt-host-the-mail-server/#findComment-556194 Share on other sites More sharing options...
jonsjava Posted June 3, 2008 Share Posted June 3, 2008 you need to add your server to the MX record (number it 10, or something), or you will always hit RBL lists, because the sending server is not on the records as an authoritative sender. Link to comment https://forums.phpfreaks.com/topic/108203-sendmail-from-website-that-doesnt-host-the-mail-server/#findComment-556221 Share on other sites More sharing options...
Rottingham Posted June 3, 2008 Author Share Posted June 3, 2008 you need to add your server to the MX record (number it 10, or something), or you will always hit RBL lists, because the sending server is not on the records as an authoritative sender. The server is listed in the MX record, though not at 10. I'll add it again as priority 10 and see what happens. Even with the server IP in the MX record at 0, mail() just fails. Trying to add it at priority 10 now! Thanks for the advice, I know nothing about the MX entries. Link to comment https://forums.phpfreaks.com/topic/108203-sendmail-from-website-that-doesnt-host-the-mail-server/#findComment-556233 Share on other sites More sharing options...
jonsjava Posted June 3, 2008 Share Posted June 3, 2008 Let me do a basic explanation of how the PHP mail() function works: You send an email <?php $to = '[email protected]'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> It uses the MTA on that server (usually, postfix, Qmail, or Courier MTA) to send that mail as <webuser>@<domain>, as the user you wanted to send as, in other words, if your login is joeblow, and your domain is domain.com, it actually sends as [email protected] (this is locally, mind you) The server, when it connects to the destination server, sends with your headers (the From: is then populated with the From: header you sent in your mail() function), so the receiving server doesn't see that it was sent as [email protected], but [email protected] instead. If you are not able to send, and you aren't getting "bounced", it's most likely an MTA issue on your hosts side. Link to comment https://forums.phpfreaks.com/topic/108203-sendmail-from-website-that-doesnt-host-the-mail-server/#findComment-556239 Share on other sites More sharing options...
Rottingham Posted June 3, 2008 Author Share Posted June 3, 2008 Thanks for the explanation! I knew all of that but a refresh is always welcome. However, the sever is a Windows small biz server and the MX entry is an IP address to that server. So if I understand right, mail(), using the appropriate headers, etc, will then redirect that email send to the IP address of the microsoft exchange server? Unfortunately this is failing on mail(); I will double check headers. Perhaps I should have been more clear. The host has an MX entry for their mail server, which is an IP address pointing to a box on the customers premise, which has Microsoft Small Biz Server 2003 that runs Microsoft Exchange Server. Am I doing anything wrong with the MX entry by pointing it to their server like that? Will the host forward the email send appropriately? Will mail() even know how to report success/failure in this fashion? And aside from there, no email goes out to recipient so failure is sure. Thanks again all. I appreciate the help. Link to comment https://forums.phpfreaks.com/topic/108203-sendmail-from-website-that-doesnt-host-the-mail-server/#findComment-556529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.