php.ini ПХП код который отправляет письма: 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 настроил нормально... Вот что пишет:
насколько я знаю в винде есть баг, из-за которого не работает sendmail Обновление есть на офф сайте мелкософта
Code: SMTP server address: ssl://smtp.gmail.com SMTP server port: 465 ну и раскомментируй OPENSSL.dll в php.ini Все пашет, сам когда-то прое...ся с отправкой