Results 1 to 8 of 8

Thread: Function.Mail?

  1. #1
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default Function.Mail?

    I have a website for a client, and it has two forms.
    They use the mail() function to send the feedback to his inbox.
    I'm getting this error when the form is submitted:

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in d:\webspace\ADMIN\zollie.net\WWW\contact.php on line 33

    The form is at www.zollie.net/contact.php, and the form submits to contact.php?form=send.

    I know I have to somehow fix this issue with ini_set since I don't have access to php.ini.

    Any feedback would be greatly appreciated?
    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Read the INI documentation in the PHP mail documentation. On Windows, you need to specify an appropriate mail server.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    thanks for that
    but I'm still confused?
    I still am not sure as to how to fix the issue
    How do I find out what mail server to specify
    and how do I specify the particular mail server?

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It depends on the domain from which you wish to send emails. If you use an @yahoo.com address, for example, the server would be smtp.yahoo.com:25, which is Yahoo!'s SMTP server. The server is the same as the SMTP server you use when you set up your email client to work with that provider.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Ok, so...
    uh...
    so if the form is submitting to alexjewell@sbcglobal.net, it will just be smpt.sbcglobal.net:25?

    ok

    so then how do I specify that in the php code, then?

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Not necessarily. It's the address it's submitting *from*, not to. The usual convention is smtp.<providerdomain>:25, but that doesn't have to hold true. As I said, it's the same server you used to set up your email client. When you've figured it out, the code is, for example:
    Code:
    ini_set('SMTP', 'smtp.sbcglobal.net');
    ini_set('smtp_port', '25');
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Ok, now I understand.
    So, somehow when the user submits the form, I have to get their email address' ending and throw it into that.
    ok
    let's see how that goes

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No! You need to set it up to use an SMTP server on which you have an account.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •