1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
<?xml version="1.0" encoding="iso-8859-2"?>
<reference id="ref.mail">
<title>Mailov funkce</title>
<titleabbrev>Mail</titleabbrev>
<partintro>
<simpara>
Funkce <function>mail</function> umouje odeslat maily.</simpara>
</partintro>
<refentry id="function.mail">
<refnamediv>
<refname>mail</refname>
<refpurpose>send mail</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>bool</type><methodname>mail</methodname>
<methodparam><type>string</type><parameter>to</parameter></methodparam>
<methodparam><type>string</type><parameter>subject</parameter></methodparam>
<methodparam><type>string</type><parameter>message</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>additional_headers
</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>mail</function> automaticky odmailuje vzkaz specifikovan v
<parameter>message</parameter> pjemci specifikovanmu v
<parameter>to</parameter>. Pidnm rky mezi adresami v
<parameter>to</parameter> mete specifikovat vce pjemc.
</simpara>
<para>
<example>
<title>Odesln mailu.</title>
<programlisting>
mail("rasmus@lerdorf.on.ca", "Mj pedmt", "dek 1\ndek 2\ndek 3");
</programlisting>
</example>
</para>
<simpara>
Pokud je pedn tvrt argument, jeho hodnota se vlo na konec hlaviek.
Toto se obvykle pouv k pidn extra hlaviek.
Vcensobn hlaviky se oddluj zadkovnm.
</simpara>
<para>
<example>
<title>Odesln mailu s extra hlavikami.</title>
<programlisting>
mail("nobody@aol.com", "pedmt", $message,
"From: webmaster@$SERVER_NAME\nReply-To: webmaster@$SERVER_NAME\nX-Mailer: PHP/" . phpversion());
</programlisting>
</example>
K vytvoen komplexnch email mete tak pout pomrn jednoduch techniky
pro tvorbu etzc.
<example>
<title>Odesln komplexnho emailu</title>
<programlisting>
/* recipients */
$recipient .= "Mary <mary@u.college.edu>" . ", " ; //vimnte si rky
$recipient .= "Kelly <kelly@u.college.edu> . ", ";
$recipient .= "ronabop@php.net";
/* subject */
$subject = "Birthday Reminders for August";
/* message */
$message .= "Nsledujc email obsahuje formtovanou ASCII tabulku\n";
$message .= "Day \t\tMonth \t\tYear\n";
$message .= "3rd \t\tAug \t\t1970\n";
$message .= "17rd\t\tAug \t\t1973\n";
/* mete pidat signaturu */
$message .= "--\r\n"; //oddlova signatury
$message .= "Birthday reminder copylefted by public domain";
/* dodaten hlaviky pro chyby, From, cc, bcc, atd */
$headers .= "From: Birthday Reminder <birthday@php.net>\n";
$headers .= "X-Sender: <birthday@php.net>\n";
$headers .= "X-Mailer: PHP\n"; // mailov klient
$headers .= "X-Priority: 1\n"; // Urgentn vzkaz!
$headers .= "Return-Path: <birthday@php.net>\n"; // Nvratov cesta pro chyby
/* Pokud chcete poslat HTML email, odkomentujte nsledujc dek */
// $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime typ
$headers .= "cc:birthdayarchive@php.net\n"; // CC
$headers .= "bcc:birthdaycheck@php.net, birthdaygifts@php.net\n"; // BCC
/* a te to odeleme */
mail($recipient, $subject, $message, $headers);
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.ezmlm-hash">
<refnamediv>
<refname>ezmlm_hash</refname>
<refpurpose>Pot hash hodnotu potebnou pro EZMLM</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>int</type><methodname>ezmlm_hash</methodname>
<methodparam><type>string</type><parameter>addr</parameter></methodparam>
</methodsynopsis>
<simpara>
<function>ezmlm_hash</function> Pot hash hodnotu, kter je poteba
pro uchovvn EZMLM mailing list v MySQL databzi.
</simpara>
<para>
<example>
<title>Vpoet hashe a pihlen uivatele</title>
<programlisting>
$user = "kris@koehntopp.de";
$hash = ezmlm_hash ($user);
$query = sprintf ("INSERT INTO sample VALUES (%s, '%s')", $hash, $user);
$db->query($query); // pouito databzov rozhran PHPLIB
</programlisting>
</example>
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|