php mail() nefunguje

Sekcia: Programovanie 05.03.2012 | 16:32
mino   Návštevník
Zdravim,
snazim sa urobit webstranku z ktorej sa budu posielat pohladnice... Este predtym ako som sa pustil do kodovania stranky, som vyskusal odoslanie jednoduchej spravy pomocou tohto skriptu:
<?php
$succes = mail("meno@gmail.com", "Skuska", "Text spravy");
if($succes)
echo 'vas email bol odoslany!';
else
echo 'vyskytla sa chyba!';
?>

Pouzivam fedoru 14 a nainstaloval som si baliky sendmail a sendmail-cf, vzdy pri spusteni skriptu mi napise "vyskytla sa chyba" cize funkcia mail vracia vzdy hodnotu false...Skusal som aj rozne nastavenia php.ini na smtp server googlu ale bez uspechu...nemam ziaden webhosting chcem to len odosielat zo svojho pc- localhostu.
Skusal som aj v sendmail.mc nastavit smtp server: dnl define('SMARHT_HOST', 'smtp.gmail.com' a potom pomocou prikazu echo "text" | /usr/sbin/sendmail email@gmail.com odoslat spravu no vypisalo mi tento log:
From MAILER-DAEMON@Milan Mon Mar 5 14:12:19 2012
Return-Path: <MAILER-DAEMON@Milan>
Received: from localhost (localhost)
by Milan (8.14.4/8.14.4) id q25DCJHw005327;
Mon, 5 Mar 2012 14:12:19 +0100
Date: Mon, 5 Mar 2012 14:12:19 +0100
From: Mail Delivery Subsystem <MAILER-DAEMON@Milan>
Message-Id: <201203051312.q25DCJHw005327@Milan>
To: <mino@Milan>
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="q25DCJHw005327.1330953139/Milan"
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

This is a MIME-encapsulated message

--q25DCJHw005327.1330953139/Milan

The original message was received at Mon, 5 Mar 2012 14:12:18 +0100
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<milan.krisko@gmail.com>
(reason: 530-5.5.1 Authentication Required. Learn more at )

----- Transcript of session follows -----
... while talking to smtp.gmail.com:
>>> MAIL From:<mino@Milan> SIZE=450
<<< 530-5.5.1 Authentication Required. Learn more at
<<< 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 v51sm61609346eef.2
554 5.0.0 Service unavailable

--q25DCJHw005327.1330953139/Milan
Content-Type: message/delivery-status

Reporting-MTA: dns; Milan
Received-From-MTA: DNS; localhost
Arrival-Date: Mon, 5 Mar 2012 14:12:18 +0100

Final-Recipient: RFC822; milan.krisko@gmail.com
Action: failed
Status: 5.5.1
Diagnostic-Code: SMTP; 530-5.5.1 Authentication Required. Learn more at
Last-Attempt-Date: Mon, 5 Mar 2012 14:12:19 +0100

--q25DCJHw005327.1330953139/Milan
Content-Type: message/rfc822

Return-Path: <mino@Milan>
Received: from Milan (localhost [127.0.0.1])
by Milan (8.14.4/8.14.4) with ESMTP id q25DCIHw005325
for <milan.krisko@gmail.com>; Mon, 5 Mar 2012 14:12:18 +0100
Received: (from mino@localhost)
by Milan (8.14.4/8.14.4/Submit) id q25DCIli005324
for milan.krisko@gmail.com; Mon, 5 Mar 2012 14:12:18 +0100
Date: Mon, 5 Mar 2012 14:12:18 +0100
From: Milan <mino@Milan>
Message-Id: <201203051312.q25DCIli005324@Milan>

test

Ako mam nastavit php.ini a sendmail.mc aby to fungovalo??
Dakujem za kazdu odpoved...

    • Re: php mail() nefunguje 05.03.2012 | 17:43
      Avatar Milan Dvorský debian,mint kde,android  Administrátor
      vyuzi pear mail + autentifikaciu ... je to lepsie, ako to riesit cez podivnu konfiguraciu sendmailu ...
      • Re: php mail() nefunguje 05.03.2012 | 18:06
        mino   Návštevník
        a netreba potom upravit aj subor php.ini ked nainstalujem balik pear mail??
        Nainstalovane to uz mam len neviem co s tym dalej.
        • Re: php mail() nefunguje 06.03.2012 | 15:49
          Avatar Milan Dvorský debian,mint kde,android  Administrátor
          http://forum.freeserver.sk/viewtopic.php?t=1005

          nizsie je aj navod presnejsi, kde je spomenuta ta autentifikacia. a nie, nemusis uz nic konfigurovat.
          • Re: php mail() nefunguje 07.03.2012 | 14:41
            mino   Návštevník
            ok skusim to...diki