Results 1 to 6 of 6
Thread: PHP mail()
Hybrid View
-
23rd July 2010 22:28 #1
PHP mail()
.
Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. a11sm478209bkc
XAMPP/Mercury Mail , SMTP Gmail. , SMTP ...
-
23rd July 2010 23:17 #2
- ...

smtp gmail , SSL 465. smtp authentication (username and password pop3/imap).
smtp authentication ( ) STARTTLS ( php SLL smtp) .
...
-
SSL, username password smtp authentication.require_once "Mail.php";
$from = "<from.gmail.com>";
$to = "<to.yahoo.com>";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
$host = "ssl://smtp.gmail.com";
$port = "465";
$username = "<myaccount.gmail.com>";
$password = "password";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
?>
., .
, .
( )
-
23rd July 2010 23:48 #3
, PEAR Mail, SMTP auth ..
, , . , PEAR ( ).
-
24th July 2010 01:36 #4
-
24th July 2010 10:25 #5
- , HOSTS , , .
hMailServer . , 2-3 PHP. hosts (C:\Windows\system32\drivers\etc\hosts - )
127.0.0.1 domain.com
127.0.0.1 www.domain.com
domain.com .
php.ini - sendmail_from ( ) , .
.
, gmail.com, , , .
-
24th July 2010 18:59 #6
. .
---------- 18:59 ---------- 11:33 ----------
, , ... , . . .




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in