SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SMTP error - Failed to connect

    (I hope this is the right forum)

    Am trying to set up on my site the ability to have people ask for a catalogue. A form needs to be filled in with the appropriate details.
    Once filled in and send is pressed the following message appears

    Code:
    Warning: mail() [function.mail]: Failed to connect to mailserver at "10.11.4.47" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp_server\www\PetalsandPatches\feedback260408.php on line 54
    I assume that it means that I have a setting wrong. I am using WAMP on my pc.
    The php.ini has the settings
    Code:
    [mail function]
    ; For Win32 only.
    SMTP = 10.11.4.47
    smtp_port = 25
    
    ; For Win32 only.
    sendmail_from = tim.knell@a.b
    In the form I am using the code
    HTML Code:
    <form method="post" action="<?=$_SERVER['PHP_SELF'] ?>">
    whilst the php itself is
    PHP Code:
    <?php
    $name 
    $_POST['name'];
    $address $_POST['address'];
    $city $_POST['city'];
    $state $_POST['state'];
    $postcode $_POST['postcode'];
    $country $_POST['country'];
    $email $_POST['email'];
    $telephone $_POST['telephone'];

    // check for valid input
    if ($name != "" AND $address != "" AND $city != "" AND $state != "" AND $postcode != ""
    // if ($name != "" )
     
    {
      
    $sendto "tim.knell@a.b"//change to your email address obviously 
      
    $subject "Petals & Patches catalogue request"
      
    $message "I would a copy of the Petals & Patches catalogue send to me please - 
       Name: 
    $name 
       Address: 
    $address 
       City/Town: 
    $city
       State: 
    $state
       Post code: 
    $postcode
       Country: 
    $country
       E-mail: 
    $email";
      
    // send 
      
    mail("$sendto""$subject""$message");
      echo 
    "Your message was sent";
     }
    ?>
    Is there anything obviously wrong?
    Or am I missing the whole point?
    ========================
    Carn the Tiges!
    www.petalsandpatches.com

  2. #2
    SitePoint Enthusiast Syam's Avatar
    Join Date
    Mar 2006
    Location
    Kochi, India
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have an smtp server at 10.11.4.47?

    Is tim.knell@a.b your email address?

  3. #3
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,692
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    Tigers,

    WinDoze does not come with an SMTP server installed. Either you need to install one or use one remotely.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2006
    Location
    Australia
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is an SMTP server at 10.11.4.47.
    It is the e-mail server for the company I work for.
    I would like to use this existing server for testing.
    How to I get my programs/laptop to make use of it?
    Is my configuration suitable?
    ========================
    Carn the Tiges!
    www.petalsandpatches.com

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2008
    Location
    Australia
    Posts
    164
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think that SMPT is not there on your server....in, windows we have to install SMPT sevrer

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,692
    Mentioned
    20 Post(s)
    Tagged
    3 Thread(s)
    Tigers!

    Use mail.yourcompany.tld (your mail server's SMTP server address) and not the IP Address (which is NOT resolving to the mail server's SMTP funtion).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •