| | | | |
| | |
| Gast
Beiträge: n/a
| Hallo zusammen, ich verwende für den Versand von Mails über einen GMX-Account die Klasse smtp von Manuel Lemos (http://www.phpclasses.org/browse/package/14.html). Wenn ich das mitgelieferte Test-Script verwende funktioniert der Versand. Wenn ich hingegen meine eigene Funktion verwende, bekomme ich den folgenden Fehler: could not determine the SMTP to connect Für beide Scripte verwende ich die gleichen Daten. Test-Script: Code: <?php
$smtp = new smtp_class;
$smtp->host_name=$host_name;
$smtp->localhost=$localhost;
$smtp->pop3_auth_host=$pop3_auth_host;
$smtp->user=$mail_user;
$smtp->realm=$realm;
$smtp->password=$mail_password;
$from=$mail_from;
$to=$mailaddress;
$inhalt = $mailtext;
$smtp->direct_delivery=0; /* Set to 1 to deliver directly to the recepient SMTP server */
$smtp->timeout=10; /* Set to the number of seconds wait for a successful connection to the SMTP server */
$smtp->data_timeout=0; /* Set to the number seconds wait for sending or retrieving data from the SMTP server. Set to 0 to use the same defined in the timeout variable */
$smtp->debug=0; /* Set to 1 to output the communication with the SMTP server */
$smtp->html_debug=1; /* Set to 1 to format the debug output as HTML */
if( $smtp->SendMessage($from,
array($to),
array(
"From: $from",
"To: $to",
"Subject: ".$betreff,
"Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z")
),
$inhalt))
echo "Message sent to $to OK.\n";
else
echo "Cound not send the message to $to.\nError: ".$smtp->error."\n"
?>
Eigene Funktion: Code: function sendEMail($empfaenger, $betreff, $mailtext)
{
$smtp = new smtp_class;
//$smtp->host_name=getenv("HOSTNAME");
$smtp->host_name=$host_name;
$smtp->localhost=$localhost;
$smtp->pop3_auth_host=$pop3_auth_host;
$smtp->user=$mail_user;
$smtp->realm=$realm;
$smtp->password=$mail_password;
$from=$mail_from;
$to=$mailaddress;
// $to = $empfaenger;
$inhalt = $mailtext;
$smtp->direct_delivery=0; /* Set to 1 to deliver directly to the recepient SMTP server */
$smtp->timeout=10; /* Set to the number of seconds wait for a successful connection to the SMTP server */
$smtp->data_timeout=0; /* Set to the number seconds wait for sending or retrieving data from the SMTP server. Set to 0 to use the same defined in the timeout variable */
$smtp->debug=0; /* Set to 1 to output the communication with the SMTP server */
$smtp->html_debug=1; /* Set to 1 to format the debug output as HTML */
if($smtp->SendMessage($from,
array($to),
array(
"From: $from",
"To: $to",
"Subject: ".$betreff,
"Date: ".strftime("%a, %d %b %Y %H:%M:%S %Z")
),
$inhalt))
{
echo "Die Nachricht wurde erfolgreich an '$to' geschickt.\n";
}
else
{
echo "Die Nachricht konnte nicht an '$to' gesendet werden.\nFehler: ".$smtp->error."\n";
}
}
Gruß, Ole |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Problem mit mail() | Blue-Dragon | PHP Tipps 2008 | 17 | 05.07.2008 22:09 |
| problem mit mail()!!! | coldi1000 | PHP Tipps 2008 | 4 | 13.11.2007 22:49 |
| [PHP] mail() Problem mit AOL Adressen | horvath-media | PHP Tipps 2006 | 25 | 23.03.2006 19:53 |
| mail() und boundary Problem | Gef | PHP Tipps 2006 | 4 | 02.03.2006 00:47 |
| php oder css problem? Wie konfiguriere ich mail header | PHP Tipps 2006 | 1 | 28.02.2006 05:43 | |
| Problem mit mail() | PHP Tipps 2006 | 5 | 08.02.2006 08:27 | |
| [Erledigt] problem mit login skript | mysql | cookie | PHP Tipps 2004-2 | 13 | 07.12.2004 19:01 | |
| Mail Problem mit Anhang | Spyker | PHP-Fortgeschrittene | 2 | 21.09.2004 21:41 |
| mailen per SMTP - Problem | PHP Tipps 2004 | 5 | 02.09.2004 15:28 | |
| Problem mit Formular + Mail To+ PHP-Seiten weiterleitung | HTML, Usability und Barrierefreiheit | 3 | 27.08.2004 11:06 | |
| Problem mit Mail | PHP Tipps 2004 | 15 | 02.08.2004 22:55 | |
| mail - Blacklist - Problem | PHP Tipps 2004 | 4 | 09.07.2004 01:04 | |
| Problem mit mail() - Funktion | PHP Tipps 2004 | 2 | 06.07.2004 18:21 | |
| Ordner per Skript erstellen --> Rechte Problem | PHP Tipps 2004 | 2 | 06.07.2004 14:19 | |
| [Erledigt] Php skript upload problem! | PHP Tipps 2004 | 2 | 30.06.2004 00:06 | |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.