php mail() script

Discussion in 'Web Design and Development' started by werther, Dec 5, 2006.

  1. werther macrumors regular

    Joined:
    May 15, 2006
    #1
    Hello everyone and thanks for any help in advance.
    php 5.1.4
    apache 1.3
    mysql 5.0.18
    mac os x ppc

    I wrote a basic registration script (php) some time ago and upon registration an email would be sent to the user. It used to work fine and now it does not. I receive no error messages but I never receive an email no matter where I send it to. I have little snitch on my computer and after hitting the register button it (little snitch) tells me that smtp wants to connect to my isp mail server tcp port 25. (all is good) but still no mail.

    I have used telnet and have verified that the port is not blocked. I also try it with no firewall no little snitch running and still nothing. I have talked to my isp and they have told me that I have not been blacklisted and that they have nothing on their on that should block it.

    I have looked in the postfix mail.log and can find no errors. Sometimes little snitch will repeatidly tell my that smtp wants to connect to 25 but instead of my isp it trys to connect to a yahoo mail server.

    if anybody has any ideas please let me know
    -thanks
     
  2. jeremy.king macrumors 603

    jeremy.king

    Joined:
    Jul 23, 2002
    Location:
    Fuquay Varina, NC
    #2
    Whats the [mail function] section of your php.ini file look like?
     
  3. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
    #3
    If it worked until now and you haven't done anything, check with your host. We had a similair issue with a client and their sendmail, turned out it was a sendmail issue on the server.
     
  4. werther thread starter macrumors regular

    Joined:
    May 15, 2006
    #4
    the script that I wrote where I realized the problem was pretty complicated. So I just scratched something very basic like:

    $body="Thank you for registering with our site.!\nYour password is '{$_POST['password1']}'.\n\nSincerely,\nUs";
    mail ($_POST['email'],'Thank you for registering!', $body, 'From:admin@site.com');
    echo '<h1 id="mainhead">Thank You!</h1><p>You are now registered. An email has been sent to your email address confirming the
    information.</p><p><br/></p>';

    which is a script I always use to make sure nothing is wrong on my end before getting to into it.

    Since I am essentially the host the problem would be postfix on my system. I might try to hose postfix and reinstall it. I guess that would be my next step.
     
  5. nightelf macrumors 6502

    Joined:
    Mar 25, 2003
    #5
    I use a function called phpmailer.

    http://phpmailer.sourceforge.net/

    Extremely easy to use, only need to include the 2 files. It lets you format the email in HTML, send attachments, cc, bcc, etc.
     
  6. werther thread starter macrumors regular

    Joined:
    May 15, 2006
    #6
    Finally got it working. I did not reinstall but simply downloaded postfix enabler from cutedgesystems and it works great! I don't understand what happened that it used to work and then quit.....but right now I could give a damn!



    Back to work
     
  7. Sdashiki macrumors 68040

    Sdashiki

    Joined:
    Aug 11, 2005
    Location:
    Behind the lens
    #7
    Im trying to add an email form to my site.

    PHP is not my cup of tea, and using the sourceforge PHPmailer only confuses me.

    Ive got this form:

    all i want is the submit button to send these 4 input boxes into an email to myself. present an "email sent" page and thats it.

    if possible using the "email address" entry as the actual email sender and the "subject" as the actual received email subject.

    "name" and "questions or feedback" is the text of the email.

    PHPmailer is capable of doing this I am pretty sure, but all that PHP code is totally greek to me.
     

Share This Page