Antichat снова доступен.
Форум Antichat (Античат) возвращается и снова открыт для пользователей.
Здесь обсуждаются безопасность, программирование, технологии и многое другое.
Сообщество снова собирается вместе.
Новый адрес: forum.antichat.xyz
 |

10.04.2008, 16:19
|
|
Флудер
Регистрация: 20.11.2006
Сообщений: 3,316
Провел на форуме: 16641028
Репутация:
2371
|
|
smtp.gmail.com и windows
php.ini
; For Win32 only.
;SMTP = localhost
;smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "D:\WebServeR\sendmail\sendmail.exe -t"
ПХП код который отправляет письма:
PHP код:
<?php
function authgMail($from, $namefrom, $to, $nameto, $subject, $message)
{
$smtpServer = "tls://smtp.gmail.com";
$port = "465";
$timeout = "45";
$username = "";
$password = "";
$localhost = $_SERVER['REMOTE_ADDR'];
$newLine = "\r\n";
$smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout);
echo $errstr." - ".$errno;
$smtpResponse = fgets($smtpConnect, 4096);
if(empty($smtpConnect))
{
$output = "Failed to connect: $smtpResponse";
echo $output;
return $output;
}
else
{
$logArray['connection'] = "Connected to: $smtpResponse";
echo "connection accepted<br>".$smtpResponse."<p />Continuing<p />";
}
fputs($smtpConnect, "HELO $localhost". $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['heloresponse2'] = "$smtpResponse";
fputs($smtpConnect,"AUTH LOGIN" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['authrequest'] = "$smtpResponse";
fputs($smtpConnect, base64_encode($username) . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['authusername'] = "$smtpResponse";
fputs($smtpConnect, base64_encode($password) . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['authpassword'] = "$smtpResponse";
fputs($smtpConnect, "MAIL FROM: <$from>" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['mailfromresponse'] = "$smtpResponse";
fputs($smtpConnect, "RCPT TO: <$to>" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['mailtoresponse'] = "$smtpResponse";
fputs($smtpConnect, "DATA" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['data1response'] = "$smtpResponse";
//$headers = "MIME-Version: 1.0" . $newLine;
//$headers .= "Content-type: text/html; charset=utf-8" . $newLine;
//$headers = "To: $nameto <$to>" . $newLine;
//$headers .= "From: $namefrom <$from>" . $newLine;
fputs($smtpConnect, "To: $to\r\nFrom: $from\r\nSubject: $subject\r\n$headers\r\n\r\n$message\r\n.\r\n");
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['data2response'] = "$smtpResponse";
fputs($smtpConnect,"QUIT" . $newLine);
$smtpResponse = fgets($smtpConnect, 4096);
$logArray['quitresponse'] = "$smtpResponse";
$logArray['quitcode'] = substr($smtpResponse,0,3);
fclose($smtpConnect);
return($logArray);
}
?>
Вроде sendmail.ini настроил нормально...
Вот что пишет:
Warning: fsockopen() [function.fsockopen]: unable to connect to tls://smtp.gmail.com:465 (Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP?) in functions.php on line 57
Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP? - 5
Warning: fgets(): supplied argument is not a valid stream resource in functions.php on line 59
Failed to connect:
|
|
|

10.04.2008, 17:04
|
|
Постоянный
Регистрация: 29.05.2007
Сообщений: 852
Провел на форуме: 4832771
Репутация:
1916
|
|
насколько я знаю в винде есть баг, из-за которого не работает sendmail
Обновление есть на офф сайте мелкософта
|
|
|

10.04.2008, 17:19
|
|
Флудер
Регистрация: 20.11.2006
Сообщений: 3,316
Провел на форуме: 16641028
Репутация:
2371
|
|
Нет..это не причина..
Месяца 3 назад все работало..я что-то сделал и вот не пашет
|
|
|

10.04.2008, 17:35
|
|
Постоянный
Регистрация: 15.03.2006
Сообщений: 600
Провел на форуме: 5091304
Репутация:
1203
|
|
Код:
SMTP server address: ssl://smtp.gmail.com
SMTP server port: 465
ну и раскомментируй OPENSSL.dll в php.ini
Все пашет, сам когда-то прое...ся с отправкой
|
|
|

12.04.2008, 04:22
|
|
Флудер
Регистрация: 20.11.2006
Сообщений: 3,316
Провел на форуме: 16641028
Репутация:
2371
|
|
ссл включен..все равно ошибка 
|
|
|

08.08.2008, 12:43
|
|
Участник форума
Регистрация: 24.06.2007
Сообщений: 299
Провел на форуме: 467372
Репутация:
212
|
|
Всё дело в smtp.gmail.com:465 - толку не будет. Пробуй - smtp.googlemail.com на 578 порт
|
|
|
|
 |
Похожие темы
|
| Тема |
Автор |
Раздел |
Ответов |
Последнее сообщение |
|
Определиние Ip
|
Dimann |
Болталка |
18 |
09.06.2008 01:06 |
|
Инет на 2 компе
|
TrypoED |
Аппаратное обеспечение |
15 |
19.03.2008 00:42 |
|
Здесь присутствуют: 1 (пользователей: 0 , гостей: 1)
|
|
|
|