« Previous Next »

Thread: php 23bit on 64bit OS mail()

Last post 05-21-2009 6:32 AM by Sean Tornado. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 05-13-2009, 9:00 AM

    php 23bit on 64bit OS mail()

    I have been working on a problem for 3days now.

    PHP is a 32bit program, its currently installed on our 64bit version of SBS2008.

    Everything works perfectly regarding php apart from mail();

    Each time I try and execute a php script involving the mail(); function i get the '500 - Internal server error.' error.

    Please does any one have a solution?

  • 05-17-2009, 9:02 AM In reply to

    Re: php 23bit on 64bit OS mail()

    What are your mail settings in php.ini? What are you doing with your php script when it fails (paste code if you can)?
    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 05-18-2009, 4:40 AM In reply to

    Re: php 23bit on 64bit OS mail()

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    smtp_port = 25

    ; For Win32 only.
    sendmail_from = me@mydomain.prg

    ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =

    ; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_parameters =

    And I tried making a email script and then tried a simple email script:
    mail('me@mydomain', 'The Subject', 'The Message');

    Its giving me the following server error:
    500 - Internal server error.

    If i try:
    @mail('me@mydomain', 'The Subject', 'The Message');

    The correct page is displayed but the email is still not being sent.

  • 05-18-2009, 4:46 AM In reply to

    Re: php 23bit on 64bit OS mail()

    Just attempted:

    [mail function]
    ; For Win32 only.
    ;SMTP = localhost
    ;smtp_port = 25

    ; For Win32 only. ;sendmail_from = me@mydomain.org

    ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
    ;sendmail_path =

    ; Force the addition of the specified parameters to be passed as extra parameters
    ; to the sendmail binary. These parameters will always replace the value of
    ; the 5th parameter to mail(), even in safe mode.
    ;mail.force_extra_parameters =

    Please excuse the spelling mistake in the last post 'me@mydomain.Org'

  • 05-18-2009, 8:47 PM In reply to

    Re: php 23bit on 64bit OS mail()

    A simple script such as;

    <?php
    mail('rcpt@example.com', 'Test Mail', 'The mail function works.');
    ?>

     Should work if your php.ini settings are correct. Make sure you have display errors turned on so that any issues are printed to screen. Alternatively, if this is a live system then enable php logging to a file or eventlog so that you can get this information. You can use ini_set() as well to set the SMTP, sendmail_from, etc.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 05-21-2009, 5:37 AM In reply to

    Re: php 23bit on 64bit OS mail()

    PHP Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay in C:\My\Web\Directory\index.php on line 10

    I have googled it and I think my SMTP server is not listening to IIS or not accepting the emails. I have attempted to change the settings in IIS7 SMTP Email thing but to no avail.

    I have checked that the ini settings are correct like the sendmail from account exists ect and port number.
    (I'm not sure about the port number but 25 is the standard SMTP port, i'll look into it you never know with windows!)

    Other than that I'm going to try changing the SMTP settings to relay messages from IIS or localhost with no authentication.

    I also looked into ini_set() and it just seams like extra code that is not required as long as IIS works.

  • 05-21-2009, 6:32 AM In reply to

    Re: php 23bit on 64bit OS mail()

    I changed my php.ini settings to send the email straight to my ISP's SMTP and the email got sent perfectly. Just out of total curiosity I tried this but I would prefer the email got sent to my SMTP then our ISP's then to the recipient. The problem must lie with our SMTP settings...
Page 1 of 1 (7 items)
Microsoft Communities