mirror of
https://gitlab.com/harald.mueller/aktuelle.kurse.git
synced 2024-10-19 18:05:02 +02:00
340 lines
18 KiB
HTML
340 lines
18 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>mail</title>
|
|
<link rel="stylesheet" type="text/css" href="../../src/self.css">
|
|
<meta name="description" content="Versendet E-Mails">
|
|
<meta name="keywords" content="SELFPHP, PHP, Mail-Funktionen, mail">
|
|
<meta name="author" content="Damir Enseleit, mail@selfphp.info">
|
|
<meta name="DC.Contributer" content="Matthias Hupp, m.hupp@selfphp3.de">
|
|
<meta name="DC.Publisher" content="Damir Enseleit, mail@selfphp.info">
|
|
<meta name="DC.Date" content="2001-08-20T12:18+01:00">
|
|
<meta name="DC.Identifier" content="http://www.selfphp3.de/funktionsreferenz/mail_funktionen/mail.html">
|
|
<meta name="DC.Language" content="de">
|
|
<meta name="DC.Rights" content="../../editorial/index.html">
|
|
<meta name="SELF.Firstdate" content="2001-08-20T12:18+01:00">
|
|
<meta name="SELF.Version" content="1">
|
|
<meta name="SELF.Pagetype" content="Information">
|
|
<meta name="SELF.Path" content="SELFPHP == ../../index.php // Funktionsreferenz == ../index.php // Mail-Funktionen == index.html">
|
|
</head>
|
|
<body bgcolor="#FFFFFF" text="#000000" link="#AA5522" vlink="#772200" alink="#000000">
|
|
|
|
<table cellpadding="4" cellspacing="0" border="0" width="100%">
|
|
<tr>
|
|
<td bgcolor="#FFEEDD" class="nav"><a class="an" name="top"><img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"></a> <a href="../../index.html"><b>SELFPHP</b></a>/<a href="../../navigation/index.html">Navigationshilfen</a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"> <a href="../index.html"><b>Funktionsreferenz</b></a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"> <a href="index.html"><b>Mail-Funktionen</b></a></td>
|
|
</tr>
|
|
</table>
|
|
<table cellpadding="4" cellspacing="0" border="0" width="100%">
|
|
<tr>
|
|
<td bgcolor="#EEEEEE" class="doc" width="110"><img src="../../src/logo.gif" width="106" height="109" border="0" alt="SEL.html"></td>
|
|
<td bgcolor="#EEEEEE" class="doc" valign="bottom" width="100%">
|
|
<h2>mail</h2></td>
|
|
</tr>
|
|
<tr>
|
|
<td bgcolor="#EEEEEE" class="doc" valign="top" align="center"> <img src="../../src/dokx.gif" width="30" height="20" vspace="6" border="0" alt="Informationsseite">
|
|
</td>
|
|
<td bgcolor="#FFFFFF" valign="top" nowrap colspan="2">
|
|
<p> <img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"> <a href="#befehl"><b>Befehl</b></a><br>
|
|
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"> <a href="#version"><b>Version</b></a><br>
|
|
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"> <a href="#beschreibung"><b>Beschreibung</b></a><br>
|
|
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"> <a href="#beispiel1"><b>Beispiel1</b></a><br>
|
|
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"> <a href="#ausgabe1"><b>Ausgabe1</b></a><br>
|
|
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"> <a href="#beispiel2"><b>Beispiel2</b></a><br>
|
|
<img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"> <a href="#ausgabe2"><b>Ausgabe2</b></a><br>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=3 bgcolor="#EEEEEE" class="doc"><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a> </td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
|
|
<h2 class="Sh2"><a class="an" name="befehl">Befehl</a></h2>
|
|
|
|
|
|
|
|
<table width="100%" cellpadding=10><tr>
|
|
<td class="xmpcode" bgcolor="#E4EEFF">bool <b>mail</b>(string to, string subject,
|
|
string message [, string additional_headers])</td>
|
|
</tr></table>
|
|
|
|
<p> </p>
|
|
|
|
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
|
|
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a> 
|
|
</td></tr></table>
|
|
|
|
<h2 class="Sh2"><a class="an" name="version">Version</a></h2>
|
|
|
|
<table width="100%" cellpadding=10 height="32">
|
|
<tr>
|
|
<td class="xmpcode" bgcolor="#E4EEFF" height="20">
|
|
<p>PHP 3, PHP 4 >= 4.0b1</p>
|
|
</td>
|
|
</tr></table>
|
|
|
|
<p> </p>
|
|
|
|
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
|
|
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a> 
|
|
</td></tr></table>
|
|
|
|
<h2 class="Sh2"><a class="an" name="beschreibung">Beschreibung</a></h2>
|
|
|
|
<table width="100%" cellpadding=10 height="247">
|
|
<tr>
|
|
<td class="xmpcode" bgcolor="#E4EEFF" height="57">
|
|
<p>Mit mail() kann man eine E-Mail im Text- oder HTML-Format an eine oder<br>
|
|
mehrere Personen versenden. Sie können in dieser Mail einen Empfänger
|
|
(to),<br>
|
|
einen Absender, ein CC , ein BCC und sogar ein Attachment festlegen, die
|
|
alle<br>
|
|
beim Versand berücksichtigt werden. <br>
|
|
Der Betreff (subject) und die Nachricht (message) werden dann mit den
|
|
obigen<br>
|
|
Daten versendet. Im Mailheader (additional_headers) können Sie verschiedene<br>
|
|
Angaben (From, Cc, Bcc etc - siehe Beispiel) machen, welche jeweils durch<br>
|
|
einen Zeilenvorschub (\n) getrennt sein müssen. <br>
|
|
Wollen Sie eine E-Mail an mehrere Personen senden, so schreiben Sie sie
|
|
im to-<br>
|
|
Bereich und trennen die einzelnen Adressen durch ein Komma(,).<br>
|
|
Im optionalen Parameter additional_parameters können Sie<br>
|
|
Befehlszeilenargumente an das Mail-Programm übergeben.</p>
|
|
<p>Zu Beispiel 1:<br>
|
|
Bei diesem Beispiel wurde per Formular eine HTML-Mail generiert und an
|
|
den<br>
|
|
Empfänger gesendet. Zusätzlich wurde eine zusätzliche E-Mail-Adresse
|
|
im BCC<br>
|
|
angegeben und weitergeleitet. Bedenken Sie bitte, dass Sie bei Einbindung
|
|
von<br>
|
|
Grafiken die absolute Adresse (im Internet) angeben müssen, da sonst
|
|
das Bild<br>
|
|
nicht angezeigt wird.<br>
|
|
Sie sollten aber lieber auf Grafiken verzichten, da der User beim Lesen
|
|
der<br>
|
|
Nachricht (wenn er offline ist) nicht sehr glücklich sein wird, dass
|
|
er online gehen<br>
|
|
muss, um sich die Grafik anzuschauen.</p>
|
|
<p>Zu Beispiel 2:<br>
|
|
Bei diesem Beispiel wurde per Formular (wie bei Beispiel 1) eine Text-Mail<br>
|
|
generiert und an den Empfänger gesendet. Zusätzlich wurde eine
|
|
E-Mail-Adresse<br>
|
|
im CC angegeben und weitergeleitet.</p>
|
|
</td>
|
|
</tr></table>
|
|
|
|
<p> </p>
|
|
|
|
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
|
|
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a> 
|
|
</td></tr></table>
|
|
|
|
<h2 class="Sh2"><a class="an" name="beispiel1">Beispiel1</a></h2>
|
|
|
|
<table width="100%" cellpadding=10 height="66">
|
|
<tr>
|
|
<td class="xmpcode" bgcolor="#E4EEFF">
|
|
<pre><?PHP<br> //Wird vom Formular ausgefuellt<br> $email_to = "$name_freund <$email_freund>"; <br> //Absender-Email<br> $email_from_mail = "mail@selfphp.info"; <br> //Absender-Name<br> $email_from_name = "Damir Enseleit"; <br> //Betreff in der Mail<br> $email_betreff = "Selfphp-Mailer";<br> //BCC<br> $email_to_bcc = "mail@selfphp4.de";<br>?>
|
|
|
|
<html><head>
|
|
<title>Selfphp-Mailer</title>
|
|
</head>
|
|
<body bgcolor="#FFFFFF">
|
|
<h4>Selfphp-Mailer</h4>
|
|
<?php
|
|
if(!isset($email_freund)){
|
|
?>
|
|
<form action="index.php" method="post">
|
|
<table width="58%" border="0" cellspacing="2" cellpadding="0">
|
|
<tr>
|
|
<td width="15%" valign="top">
|
|
Name/Freund:
|
|
</td>
|
|
<td width="85%">
|
|
<input type="text" name="name_freund">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%" valign="top">
|
|
Email/Freund:
|
|
</td>
|
|
<td width="85%">
|
|
<input type="text" name="email_freund">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%" valign="top">
|
|
Kommentar:
|
|
</td>
|
|
<td width="85%">
|
|
<textarea cols="30" rows="6" name="kommentar"></textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td width="15%" valign="top">&nbsp;</td>
|
|
<td width="85%">
|
|
<input type="submit" value="HTML-Mail senden" name="submit">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form> </pre>
|
|
<pre><?php
|
|
}
|
|
else{
|
|
$emailbody = '
|
|
<html>
|
|
<!--
|
|
Hallo ' . $name_freund . '
|
|
Ihr System unterstuetzt keine HTML-Mails!
|
|
Folgende Nachricht wurde Ihnen uebermittelt:
|
|
' . $kommentar . '
|
|
-->
|
|
<body bgcolor="#FFFFFF" text="#000000">
|
|
<table cellpadding="4" cellspacing="0" border="0" width="100%">
|
|
<tr>
|
|
<td bgcolor="#FFEEDD" >
|
|
<b>SELFPHP: Version 1.0.0 , Autor: Damir Enseleit</b>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellpadding="4" cellspacing="0" border="0" width="100%">
|
|
<tr>
|
|
<td bgcolor="#EEEEEE" >
|
|
<img src="http://www.selfphp3.de/src/logo.gif" width="106" height="109" border="0" alt="SELFHTML">
|
|
</td>
|
|
<td bgcolor="#EEEEEE" valign="bottom" width="100%">
|
|
Dynamische Webapplikationen:<br>
|
|
<b>PHP-Dateien selbst erstellen</b>
|
|
<h1>Newsletter</h1>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td bgcolor="#EEEEEE" valign="top" align="center">
|
|
<h2>Inhalt</h2>
|
|
</td>
|
|
<td bgcolor="#FFFFFF" valign="top" width="100%">
|
|
<h2>Hallo ' . $name_freund . '</h2>
|
|
<p><b>Das ist Deine Nachricht:</b></p>
|
|
<pre><font face="Verdana,Geneva,Arial, Helvetica,sans-serif" color="#006600">'
|
|
. $kommentar .
|
|
'</font></pre>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan=2 bgcolor="#EEEEEE" >
|
|
<img src="http://www.selfphp3.de/src/up.gif" width="14" height="10" border="0" alt="nachoben">&#160;
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<p>&copy; 2001<img src="http://www.selfphp3.de/src/mail.gif" width="15" height="10" border="0" alt="E-Mail">
|
|
&nbsp;<a href="mailto:mail@selfphp.info">Damir Enseleit, mail@selfphp.info</a></p>
|
|
</body>
|
|
</html>
|
|
'; </pre>
|
|
<pre>$header="From:$email_from_name<$email_from_mail>\n";
|
|
$header .= "Reply-To: $email_from_mail\n";
|
|
$header .= "Bcc: $email_to_bcc\n";
|
|
$header .= "X-Mailer: PHP/" . phpversion(). "\n";
|
|
$header .= "X-Sender-IP: $REMOTE_ADDR\n";
|
|
$header .= "Content-Type: text/html";
|
|
mail($email_to,$email_betreff,$emailbody,$header);
|
|
echo "<p>Sende Email nach: $email_freund<br>
|
|
Sende Email(BCC) nach: $email_from_mail";
|
|
}
|
|
?>
|
|
</body>
|
|
</html></pre>
|
|
</td>
|
|
</tr></table>
|
|
|
|
<p> </p>
|
|
|
|
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
|
|
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a> 
|
|
</td></tr></table>
|
|
|
|
|
|
<h2 class="Sh2"><a class="an" name="ausgabe1">Ausgabe1</a></h2>
|
|
|
|
<table width="100%" cellpadding=10 height="45">
|
|
<tr>
|
|
<td class="xmpcode" bgcolor="#E4EEFF" height="57">
|
|
<p><b>Ausfüllen des Formular:</b></p>
|
|
<p><img src="../funktionsgrafiken/mail_0.gif" width="394" height="430"></p>
|
|
<p><b>Bestätigung beim Versenden:</b></p>
|
|
<p><img src="../funktionsgrafiken/mail_1.gif" width="394" height="269"></p>
|
|
<p><b>Fertige Email beim Empfänger:</b></p>
|
|
<p><img src="../funktionsgrafiken/mail_2.gif" width="396" height="611"></p>
|
|
</td>
|
|
</tr></table>
|
|
|
|
|
|
<p> </p>
|
|
|
|
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
|
|
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a> 
|
|
</td></tr></table>
|
|
|
|
<h2 class="Sh2"><a class="an" name="beispiel2">Beispiel2</a></h2>
|
|
|
|
<table width="100%" cellpadding=10 height="66">
|
|
<tr>
|
|
<td class="xmpcode" bgcolor="#E4EEFF">
|
|
<pre><?PHP<br> //Wird vom Formular ausgefuellt<br> $email_to = "$name_freund<$email_freund>"; <br> //Absender-Email<br> $email_from_mail = "mail@selfphp4.de"; <br> //Absender-Name<br> $email_from_name = "Damir Enseleit"; <br> //Betreff in der Mail<br> $email_betreff = "Selfphp-Mailer";<br> //CC<br> $email_to_cc="Matthias Hupp<mail@selfphp.info>";<br>?><br><html><head> <br><title>Selfphp-Mailer</title> <br></head><br><body bgcolor="#FFFFFF"> <br><h4>Selfphp-Mailer</h4> <br><?php <br>if(!isset($email_freund)){ <br>?><br><form action="index.php" method="post"> <br><table width="58%" border="0" cellspacing="2" cellpadding="0"><br> <tr><br> <td width="15%" valign="top"><br> Name/Freund:<br> </td><br> <td width="85%"> <br> <input type="text" name="name_freund"><br> </td><br> </tr><br> <tr><br> <td width="15%" valign="top"><br> Email/Freund:<br> </td><br> <td width="85%"> <br> <input type="text" name="email_freund"><br> </td><br> </tr><br> <tr><br> <td width="15%" valign="top"><br> Kommentar:<br> </td><br> <td width="85%"> <br> <textarea cols="30" rows="6"name="kommentar"></textarea><br> </td><br> </tr><br> <tr><br> <td width="15%" valign="top">&nbsp;</td><br> <td width="85%"> <br> <input type="submit" value="HTML-Mail senden" name="submit"><br> </td><br> </tr>
|
|
</table><br></form> <br><?php <br>} <br>else{ <br> $header="From:$email_from_name<$email_from_mail>\n"; <br> $header .= "Cc: $email_to_cc\n"; <br> mail($email_to,$email_betreff,$kommentar,$header);<br>}<br>?></pre>
|
|
</td>
|
|
</tr></table>
|
|
|
|
<p> </p>
|
|
|
|
<table bgcolor="#EEEEEE" class="doc" width="100%"><tr><td>
|
|
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a><a href="#bottom"><img src="../../src/down.gif" width="14" height="10" border="0" alt="nach unten"></a> 
|
|
</td></tr></table>
|
|
|
|
|
|
<h2 class="Sh2"><a class="an" name="ausgabe2">Ausgabe2</a></h2>
|
|
|
|
<table width="100%" cellpadding=10 height="45">
|
|
<tr>
|
|
<td class="xmpcode" bgcolor="#E4EEFF" height="57">
|
|
<p><img src="../funktionsgrafiken/mail_3.gif" width="396" height="272"></p>
|
|
<p></p>
|
|
</td>
|
|
</tr></table>
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
<table cellpadding="4" cellspacing="0" border="0" width="100%">
|
|
<tr><td colspan=2 bgcolor="#EEEEEE" class="doc">
|
|
<a href="#top"><img src="../../src/up.gif" width="14" height="10" border="0" alt="nach oben"></a>
|
|
</td></tr>
|
|
<tr>
|
|
<td bgcolor="#EEEEEE" class="doc" align="right" width="110">weiter:<a href="../mathematische_funktionen/index.html"><img src="../../src/next.gif" width="10" height="10" border="0" hspace="10" alt="weiter"></a></td>
|
|
<td bgcolor="#FFFFFF"><img src="../../src/dok.gif" width="15" height="10" border="0" alt="Seite">
|
|
<a href="../mathematische_funktionen/index.html"><b>Mathematische-Funktionen</b></a> </td>
|
|
</tr>
|
|
<tr>
|
|
<td bgcolor="#EEEEEE" class="doc" align="right" width="110">zurück:<a href="index.html"><img src="../../src/prev.gif" width="10" height="10" border="0" hspace="10" alt="zurück"></a></td>
|
|
<td bgcolor="#FFFFFF" width="100%"><img src="../../src/dok.gif" width="15" height="10" border="0" alt="Seite">
|
|
<a href="index.html"><b>Mail-Funktionen</b></a> </td>
|
|
</tr>
|
|
<tr><td colspan=2 bgcolor="#EEEEEE" class="doc"> </td></tr>
|
|
</table><table cellpadding="4" cellspacing="0" border="0" width="100%">
|
|
<tr>
|
|
<td bgcolor="#FFEEDD" class="nav"><a class="an" name="bottom"><img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von"></a>
|
|
<a href="../../index.html"><b>SELFPHP</b></a>/<a href="../../navigation/index.html">Navigationshilfen</a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von">
|
|
<a href="../index.html"><b>Funktionsreferenz</b></a> <img src="../../src/refkap.gif" width="16" height="13" border="0" alt="Teil von">
|
|
<a href="index.html"><b>Mail-Funktionen</b></a></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p><a class="an" name="bottom">© 2001, 2002, 2003</A> <img src="../../src/mail.gif" width="15" height="10" border="0" alt="E-Mail"> <a href="mailto:mail@selfphp.info">Damir Enseleit, mail@selfphp.info</a></p>
|
|
|
|
|
|
|
|
</body>
|
|
</html> |