Login
Username:

Password:


Lost Password?

Register now!
Mainmenue
FAQ - Speedlinks
PHP - Manual - Speedlinks
SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)
FAQ > Mail

Wie kann ich eine E-Mail über php Senden? (Unix)
Requested and Answered by Admin on 28-Nov-2005 23:26 (321 reads)
Vorraussetzung: Hierfür muss auf dem Rechner ein SMTP Server installiert sein ist allerdings Standard auf Unixsystemen.

Das senden geht dann ganz leicht:

 
<?php
$eMail_from = 'name@domain.de';
$eMail_to = 'name@domain.de, name1@domain1.de';//Mit Komma kann man belibig viele Emails anhaengen
$subject = 'Betreff';
$message = 'Hallo, hier ist meine message';
 
//Header wichtig beim senden
$header = 'From: Betreff '. $eMail_from .'\r\n';
$header .= 'TO: Name <name@domain.de>, Name2 <name1@domain1.de>\r\n';
$header .= 'Cc: bla1@domain3.com\r\n';
$header .= 'Bcc: bla4@domain3.com\r\n';
//Fuer Normale Texte
$header .= 'Content-Type: text/plain; charset=\'iso-8859-1\'\r\n';
//Fuer HTML Mails den Contenttyp austauschen
//$header .= 'Content-type: text/html; charset=iso-8859-1\r\n';
 
mail($eMail_to, $subject, $message, $header);
?>
 


The comments are owned by the poster. We aren't responsible for their content.
php.a-bout.de ©2007 Stefan Freisler
Valid XHTML 1.0 Transitional Valid CSS!