|
|
|
| В папке sendmail/error.log в логах почему то ошибка авторизации, хотя все ввожу верно
10.05.29 18:32:25 : Authentication failed.<EOL>
10.05.29 18:36:36 : Authentication failed.<EOL>
|
В общем я сделал свой почтовый ящик такого типа support@мой_домен.ru
Перечитал кучу гидов, от которых голова пухнет, уже так запутался...
Что нужно для начала сделать? Если у меня есть свой почтовый домен.
Использовать отправку через SMTP или через Sendmail? Или надо через то и другое?
Допустим надо через то и другое. Я установил себе программу sendmail, вписал настройки в нее sendmail.ini пароль от почты и саму почту. Вписал настройки php.ini где находится дериктроия sendmaila.
Вот скрипт
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Mail</title>
</head>
<script src="js/time.js" type="text/javascript"></script>
<body>
<?php
$addr = $_POST['addr'];
$theme = $_POST['theme'];
$text = $_POST['text'];
if (isset($addr) && isset($theme) && isset($text)
&& $addr != "" && $theme != "" && $text != "") {
if (mail($addr, $theme, $text, "From: <a href='mailto:support@мой_домен.ru'>support@мой_домен.ru</a>")) {
echo "<h3>Сообщение отправлено</h3>";
}
else {
echo "<h3>При отправке сообщения возникла ошибка</h3>";
}
}
?>
<form action="mail.php" method="post">
<p>
<label for="addr">eMail:</label>
<input type="text" name="addr" id="addr" size="30" />
</p>
<p>
<label for="theme">Тема письма:</label>
<input type="text" name="theme" id="theme" size="30" />
</p>
<p>
<label for="text">Текст письма:</label>
<textarea rows="10" cols="20" name="text" id="text"></textarea>
</p>
<p>
<input type="submit" value="Отправить" />
</p>
</form>
</body>
</html>
|
Настройки sendmail.ini
; configuration for fake sendmail
; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail
[sendmail]
; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.
smtp_server=smtp.мой_домен.ru
; smtp port (normally 25)
smtp_port=25
; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL
smtp_ssl=auto
; the default domain for this server will be read from the registry
; this will be appended to email addresses when one isn't provided
; if you want to override the value in the registry, uncomment and modify
default_domain=мой_домен
; log smtp errors to error.log (defaults to same directory as sendmail.exe)
; uncomment to enable logging
error_logfile=error.log
; create debug log as debug.log (defaults to same directory as sendmail.exe)
; uncomment to enable debugging
;debug_logfile=debug.log
; if your smtp server requires authentication, modify the following two lines
auth_username=<a href="mailto:моя_почта@домен.ru">моя_почта@домен.ru</a>
auth_password=Пароль_от_ящика
; if your smtp server uses pop3 before smtp authentication, modify the
; following three lines. do not enable unless it is required.
pop3_server=pop.мой_домен.ru
pop3_username=<a href="mailto:моя_почта@домен.ru">моя_почта@домен.ru</a>
pop3_password=Пароль_от_ящика
; force the sender to always be the following email address
; this will only affect the "MAIL FROM" command, it won't modify
; the "From: " header of the message content
force_sender=<a href="mailto:моя_почта@домен.ru">моя_почта@домен.ru</a>
; force the sender to always be the following email address
; this will only affect the "RCTP TO" command, it won't modify
; the "To: " header of the message content
;force_recipient=
; sendmail will use your hostname and your default_domain in the ehlo/helo
; smtp greeting. you can manually set the ehlo/helo name if required
hostname=мой_домен.ru
|
Настройки php.ini
[mail function]
; For Win32 only.
SMTP = smtp.мой_домен.ru
smtp_port = 25
; For Win32 only.
sendmail_from = support@мой_домен.ru
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "C:\wamp\sendmail\sendmail.exe -t"
|
Что не так? Пишет При отправке сообщения возникла ошибка | |
|
|
|
|
|
|
|
для: Ванек2010
(29.05.2010 в 16:57)
| | Ошибка была в sendmail.ini ... | |
|
|
|