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

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    This could help you too

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...