php sendmail problem

Discussion in 'PHP' started by google, Nov 21, 2007.

  1. google

    google New Member

    Nov 21, 2007
    Likes Received:
    Trophy Points:

    I have seen your postings on PHP on this forum so I am writing to you.

    I am facing some problems with sendmail function in PHP, below is the code I am using.

    $fd = popen("/usr/sbin/sendmail -t","w") or die("Couldn't Open Sendmail");
    fputs($fd, "To:".$tomail." \n");
    fputs($fd, "From: \"ezfmx\" <> \n");
    fputs($fd, "Reply-To: \"ezfmx\" <> \n");
    fputs($fd, "Subject: Test message from my web site \n");
    fputs($fd, "X-Mailer: PHP5 \n\n");
    fputs($fd, "{$contents} \n");

    I have tried changing the headers and used mail() function as well. and the problem is this code only sends email to GMAIL and only my office mail ID. except that no other mail id seems to work. Hotmail, yahoo, and other domains seems not working at all.

    I feel its not something to do with code. So, I doubt whether we need to register our mail server some where to tell that it is not spammer.

    I am not able to find proper info on this since last two days.

    can you please let me know what the problem is or if there is nayhting to do about it?

    Thanks in advance for your time and help.
  2. pradeep

    pradeep Team Leader

    Apr 4, 2005
    Likes Received:
    Trophy Points:
    Kolkata, India
    Home Page:
    The problem with many Mail service providers is that they don't accept from all IP addresses, they only accept from known servers. May be the IP you are sending from an IP that is blacklisted. Also, check the spam folder if the mails you are sending have been marked as spam.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice