We are in the process of migrating this forum. A new space will be available soon. We are sorry for the inconvenience.

aktywacja konta , ustawinia hosta smtp


Pabblo
30-03-2009, 14:52
Witam jestem w posiadaniu pewnego skryptu do rejestracji. Niestety mimo licznych prob nie udalo mi sie go skonfgurowac tak by wysylal na maila (podanego przez uzytkownika) haslo potrzebne do aktywacji konta. Pojawia sie taki komunikat:

GENERAL ERROR: Could not connect to smtp host : 0 : php_network_getaddresses: getaddrinfo failed: Name or service not known 120 /home/vol8/byethost18.com/b18_3225274/htdocs/bin/qt_lib_smtp.php

Ponizej zamieszcze kod pliku do ktorego odonosi sie ow blad. Bardzo bym prosil o pomoc, moze moglby ktos zerknac co jest w tym kodzie nie tak ew. pomogl mi go poprawnie skonfigurowac tudiez powiedziec jak przypisac na slale ustawienia serwera poczty hosta itp. Za pomoc z gory dziekuje.

Zawartosc pliku qt_lib_smtp.php

Kod:
1 )
      {
        $headers = join("\n", $headers);
      }
      else
      {
        $headers = $headers[0];
      }
    }
    $headers = chop($headers);

    // Make sure there are no bare linefeeds in the headers
    $headers = preg_replace('#(?\r\n");
  server_parse($socket, "250", __LINE__);

  // Specify each user to send to and build to header.
  $to_header = '';

  // Add an additional bit of error checking to the To field.
  $mail_to = (trim($mail_to) == '') ? 'Undisclosed-recipients:;' : trim($mail_to);
  if ( preg_match('#[^ ]+\@[^ ]+#', $mail_to) )
  {
    fputs($socket, "RCPT TO: <$mail_to>\r\n");
    server_parse($socket, "250", __LINE__);
  }

  // Ok now do the CC and BCC fields...
  @reset($bcc);
  while(list(, $bcc_address) = each($bcc))
  {
    // Add an additional bit of error checking to bcc header...
    $bcc_address = trim($bcc_address);
    if ( preg_match('#[^ ]+\@[^ ]+#', $bcc_address) )
    {
      fputs($socket, "RCPT TO: <$bcc_address>\r\n");
      server_parse($socket, "250", __LINE__);
    }
  }

  @reset($cc);
  while(list(, $cc_address) = each($cc))
  {
    // Add an additional bit of error checking to cc header
    $cc_address = trim($cc_address);
    if ( preg_match('#[^ ]+\@[^ ]+#', $cc_address) )
    {
      fputs($socket, "RCPT TO: <$cc_address>\r\n");
      server_parse($socket, "250", __LINE__);
    }
  }

  // Ok now we tell the server we are ready to start sending data
  fputs($socket, "DATA\r\n");

  // This is the last response code we look for until the end of the message.
  server_parse($socket, "354", __LINE__);

  // Send the Subject Line...
  fputs($socket, "Subject: $subject\r\n");

  // Now the To Header.
  fputs($socket, "To: $mail_to\r\n");

  // Now any custom headers....
  fputs($socket, "$headers\r\n\r\n");

  // Ok now we are ready for the message...
  fputs($socket, "$message\r\n");

  // Ok the all the ingredients are mixed in let's cook this puppy...
  fputs($socket, ".\r\n");
  server_parse($socket, "250", __LINE__);

  // Now tell the server we are done and close the socket...
  fputs($socket, "QUIT\r\n");
  fclose($socket);

  return TRUE;
}

?>