Solved
Email mittels smtp durch php-script
7 years ago
Ich versuche gerade ein PHP-Script zum Versenden auf SMTP umzurüsten und verstehe gerade nicht wie dazu die Konfiguration aussehen muss.
Können Sie mir bitte helfen was für die einzelnen Parameter eingesetzt werden muss?
Hier ist ein beispielhaftes Script:
require_once "Mail.php";
$from = "Sandra Sender <[xxx]@t-online.de>";
$to = "Ramona Recipient <[xxx]@somewhere.com>";
$subject = "Hi!";
$body = "Hi,How are you?";
$host = "securesmtp.t-online.de";
$port = 465;
$username = "USERNAME";
$password = "PASSWORD";
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp', array ('host' => $host,
'port' => $port,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
echo("<p>Message successfully sent!</p>");
}
*E-Mail-Adressen editiert. Bitte posten Sie keine persönlichen Daten. Nadine H. vom Telekom hilft Team
667
0
4
This could help you too
You might also be interested in
Request purchasing advice
Fill out our online contact form quickly and easily so that we can advise you personally in a timely manner.
View offers
Informieren Sie sich über unsere aktuellen Website-Angebote.