Results 1 to 6 of 6

Thread: PHP mail()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User DarkPaIn's Avatar
    Join Date: Mar:2008
    Location:
    Posts: 1,773

    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 ...

  2. #2
    Registered User no shuffle's Avatar
    Join Date: Feb:2003
    Location: The Land of Rape and Honey (aka Bulgaria)
    Posts: 629
    - ...
    smtp gmail , SSL 465. smtp authentication (username and password pop3/imap).
    smtp authentication ( ) STARTTLS ( php SLL smtp) .
    ...

    -

    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>");
    }

    ?>
    SSL, username password smtp authentication.

    .
    , .
    , .
    ( )

  3. #3
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    , PEAR Mail, SMTP auth ..
    , , . , PEAR ( ).

  4. #4
    Registered User DarkPaIn's Avatar
    Join Date: Mar:2008
    Location:
    Posts: 1,773
    PC, mail()... PEAR. ... .

  5. #5
    Registered User tedych's Avatar
    Join Date: Nov:2003
    Location:
    Posts: 17,654
    - , 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, , , .

  6. #6
    Registered User DarkPaIn's Avatar
    Join Date: Mar:2008
    Location:
    Posts: 1,773
    . .

    ---------- 18:59 ---------- 11:33 ----------

    , , ... , . . .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |