Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2007
    Location
    Seattle
    Posts
    91

    strange email form issue

    If e-mails are hosted on local network server or through a different service provider, and the website is hosted (cpanel hosting) by a different company, php forms don't work on the website. Emails will not be sent, but the e-mails are sent to my domain (which is not hosted on cpanel).

    Any clue on how i can fix this or why this happens?
    Last edited by vajjas1; 03-20-2008 at 08:49 PM. Reason: typo

  2. #2
    Join Date
    Aug 2002
    Location
    Canada
    Posts
    665
    You may need to clarify your question a bit, reads very ambiguously for me! Just me?

    There are some answers you can consider from the get go though:

    - are you sending via SMTP, or relying on the local MTA?
    - how is the MTA setup? Does it permit mail from 'nobody'? Is your php running a su patch that sends mail as its username?

    more importantly:

    - you _should_ use authenticated SMTP. Have you tried some of the more popular mailer classes such as php mailer? http://phpmailer.codeworxtech.com/

    lastly, does the mail service being used have proper records in place? valid MX records (never know), domain keys, SPF identification, as well as valid RDNS records for your MX entries can all affect mail transmission! In my businesses' experience, I'd grossly estimate that 40% of mail problems are related to DNS zones in conjunction with overzealous spam filters

    Good luck!
    Alex
    circlical - hosting software development
    forums * blog

  3. #3
    Join Date
    Feb 2008
    Posts
    64
    If e-mails are hosted on local network server or through a different service provider, and the website is hosted (cpanel hosting) by a different company, php forms don't work on the website.
    I know there is no question mark, but is this a question? If it is, and I understand it correctly, you are asking if you can send email from a script on your server, but you want to send it through an email address that is hosted elsewhere, like your isp. I do not think you will be able to do this.

    If you have access to Cpanel, but not WHM, your mail may be set up already, you just have to create an account and send mail via that account.

    Emails will not be sent, but the e-mails are sent to my domain (which is not hosted on cpanel).
    I *think* you are saying that you do receive emails, just not the ones you expect to receive from a form submission. If so, this could also be an incorrectly configured script issue.

    Quote Originally Posted by Saeven View Post
    You may need to clarify your question a bit, reads very ambiguously for me!
    I agree.

    And if it is not a script issue, or related to the first section, I think the MX record should be the first thing to look at. Later you can worry about the other stuff.

    From command line, do:
    Code:
    dig mx yourdomainnamehere.com
    If you have WHM, go to Edit DNS Zone then choose the zone, that will give you same information and more (you can probably see this in Cpanel also, just not sure how).

    I'm not sure if this really helps, but I hope so

  4. #4
    Join Date
    Jun 2007
    Location
    Seattle
    Posts
    91
    "I know there is no question mark, but is this a question? If it is, and I understand it correctly, you are asking if you can send email from a script on your server, but you want to send it through an email address that is hosted elsewhere, like your isp. I do not think you will be able to do this.

    If you have access to Cpanel, but not WHM, your mail may be set up already, you just have to create an account and send mail via that account."

    I will try to explain better and give the actual example: we are hosting a website (just the website) so its A record is pointed to our IP. But its names servers are pointed to bluhost.com as their e-mail is hosted with bluhost. We have a simple contact form on their website which are using a SEND Mail script. The MX Records are pointed to their local MS Exchange server from the domain control panel. Are you saying that even in CPANEL we have to add MX records?

  5. #5
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    CPanel will attempt to deliver mail locally to a domain it hosts unless you specifically tell it the mail is hosted elsewhere. If you have root access to the CPanel server you can remove the domain from /etc/localhosts and add it to /etc/remotehosts. Or if not you can achieve the same thing by setting the external MX record in CPanel / WHM (yes, this is necessary even though your dns is hosted elsewhere).

    HTH
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  6. #6
    Join Date
    Jun 2007
    Location
    Seattle
    Posts
    91
    "external MX record in CPanel", ok so i should get the MX record for his domain and add it in my cpanel, am i right?

    Thanks Chris

  7. #7
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    5,842
    Yes that's correct. If you don't have access to set the MX record in CPanel you'll need to ask your host to do it.
    Chris

    "Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them." - Laurence J. Peter

  8. #8
    Also, make sure the domain is in the /etc/remotedomains list of the server.

    The mail services first check this file in order to make sure if they process the mail locally or remotely.

  9. #9
    Join Date
    Jun 2007
    Location
    Seattle
    Posts
    91
    wonderful thank you guys, i will try that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •