php sendmail problem

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

  1. google

    google New Member

    Joined:
    Nov 21, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    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\" <support@mclab.kr> \n");
    fputs($fd, "Reply-To: \"ezfmx\" <support@mclab.kr> \n");
    fputs($fd, "Subject: Test message from my web site \n");
    fputs($fd, "X-Mailer: PHP5 \n\n");
    fputs($fd, "{$contents} \n");
    pclose($fd);


    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, Naver.com 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

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    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