SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: mail() function

  1. #1
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mail() function

    hi guys...

    I need input on the mail() function in PHP. When I specify the following command, as in the PHP documentation page under the mail() function:

    mail("someone@something.com", "My Subject", "Line 1\nLine 2\nLine 3");

    I get a "Warning: Failed to Connect in c:\program files\apache group\apache\htdocs\pdc_emp mainpage.php"

    I understand that you need to open the php.ini file (in my case, the files is called php.ini-optimized, is it the same?) and enter the SMTP local mail server hostname or IP address.

    Correct me if I'm wrong, but the section I'm ref. in the php.ini-optimized file is:

    [mail function]
    SMTP = localhost ; for win32 only
    sendmail_from = me@localhost.com ;for win32 only
    sendmail_path = ;for unix only, may supply arguments as well (default is 'sendmail -t -i')

    I understand you need to change the "localhost" part to an SMTP server. Problem is, no one seems to know the add. of the SMTP server in my company! I am running this prog. on my own PC for testing purposes.

    I have heard that I can *somehow* convert my local workstation (running Win2k Pro) to a SMTP server via a program. Any idea where I can get this program.. if I am correct in my assumptions at all?

    Thanks for the assist!

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can either open your email program and find the address of the SMTP server it uses, or follow these steps to start the SMTP server included with Win2k:

    Go to start->control panel->settings->administrative tools

    Open up the Internet Services Manager

    Click the [+] next to your hostname on the left, and then right-click and select start on the SMTP service.

    Then, 'localhost' will work. Tell me how my instructions worked, as they were from memory, so I might have gotten something wrong.

  3. #3
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by qslack
    You can either open your email program and find the address of the SMTP server it uses, or follow these steps to start the SMTP server included with Win2k:

    Go to start->control panel->settings->administrative tools

    Open up the Internet Services Manager

    Click the [+] next to your hostname on the left, and then right-click and select start on the SMTP service.

    Then, 'localhost' will work. Tell me how my instructions worked, as they were from memory, so I might have gotten something wrong.
    Hm... ok.. I managed to get is so far, until Admin. Tools. There is NO "Internet Services Manager". What U have under Admin tools are the following:

    Component Services
    Computer Mgt
    Data Sources (ODBC)
    Event Viewer
    Local Security Policy
    Performance
    Server Extensions Administrator
    Services
    Telnet Admininstration

    And idea what to do next? perhaps I can run a command in the Run box or something... make it easier...?

    Thanks anyway!

  4. #4
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, do this:

    Go to start->settings->control panel->add or remove programs

    Then go to Windows Components (on the left). Check the box next to Internet Information Services and hit next, and install it. Then do the steps I proposed in my earlier post.

  5. #5
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by qslack
    Ok, do this:

    Go to start->settings->control panel->add or remove programs

    Then go to Windows Components (on the left). Check the box next to Internet Information Services and hit next, and install it. Then do the steps I proposed in my earlier post.
    oh crap. I need the Windows 2000 Pro CD don't I.... since my workstation terminal's part of the company. I've called Tech SUpport.. and apparently I can't simply walk in and get the CD!

    Sigh.. will have to get the CD somehow. Will post again when I manage to install IIS and run the program.

    Later!

  6. #6
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    YESS! Managed to get the IIS running..

    but i have a different error now. It now reports:

    Warning: Server Error in c:\program files\apache group\apache\htdocs\pdc_emp mainpage.php

    Any idea on what to do next? Anything I need to configure on my PC or thru the php.ini-optimized file? The server is now set to "localhost" in the php.ini file now.

  7. #7
    SitePoint Addict
    Join Date
    Jun 2001
    Location
    Malaysia
    Posts
    352
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by infinitium
    YESS! Managed to get the IIS running..

    but i have a different error now. It now reports:

    Warning: Server Error in c:\program files\apache group\apache\htdocs\pdc_emp mainpage.php

    Any idea on what to do next? Anything I need to configure on my PC or thru the php.ini-optimized file? The server is now set to "localhost" in the php.ini file now.
    Sigh.. tried everything I know.. but that darn warning still comes out!! What am I missing... I even checked the php.ini file that the "localhost" is specified.

    Any ideas, guys?


Bookmarks

Posting Permissions

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