previousBevezetés (Previous) (Next) Mail::send()next

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Mail::factory()

Mail::factory() – létrehoz egy mailer példányt

Synopsis

require_once 'Mail.php';

object &factory ( string $backend , array $params = array() )

Description

Létrehoz egy példányt a megadott backend-specifikus mailer osztályból.

Parameter

  • string $backend - a backend neve "mail" ,"smtp" , "sendmail"

  • array $params - egy tömb backend-specifikus paraméterekkel.

    Paraméterek a különböző backend-ekhez:

    • mail

      • Ha a safe mode kikapcsolt állapotban van, a $params paraméter a PHP mail() függvényének ötödik paraméterként kerül átadásra. Ha a $params paraméter egy tömb, az elemei szóközökkel tagolt sztringgé lesznek egyesítve.

    • sendmail

      • $params["sendmail_path"] - A sendmail program elérési útvonala a fájlrendszerben. Alapértelmezett értéke /usr/bin/sendmail

      • $params["sendmail_args"] - További átadandó paraméterek a sendmail programnak.

    • smtp

      • $params["host"] - A csatlakozásra kijelölt szerver. Alapértelmezett értéke localhost

      • $params["port"] - A csatlakozás portja. Alapértelmezett értéke 25

      • $params["auth"] - SMTP authentikáció használatának engedélyezése. Alapértelmezett értéke FALSE

      • $params["username"] - Felhasználónév az SMTP authentikációhoz.

      • $params["password"] - Jelszó az SMTP authentikációhoz.

      • $params["persist"] - Beállítja, hogy az SMTP authentikáció érvényben maradjon-e a send() metódus egymás utáni meghívásai között.

Return value

object - a megadott Mail példány vagy egy PEAR_Error objektum hiba esetén

Throws

Possible PEAR_Error values
Hibakód Hibaüzenet Ok Megoldás
NULL "Unable to find class for driver xxx " A mailer backend osztály nem található. Ellenőrizzük a $backend paramétert, amennyiben helyes, telepítsük újra és/vagy frissítsük a Mail csomagot.

Note

This function should be called statically.

previousBevezetés (Previous) (Next) Mail::send()next

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: Joe
There is hard-coded -f option in Mail_sendmail->send so it is impossible to set it using $params['sendmail_args']. It is hard-coded to -f$from.

In my case it caused 'X-Authentication-Warning' in mail headers.
Note by: shaun@shaunfreeman.co.uk
When sending mail via smtp be careful with the $params["auth"] option, the docs say it set it either to true or false, but in my case this didn't work and only when I set it to the actual authentication method of the server it worked. In my case I had to set it to:

$params["auth"] = "PLAIN";

This little problem had me going around in circles for 2 weeks!