Jump to content
Froxlor Forum
  • 0

mit PHP anmelden am lokal installierten Mailserver


arbyter

Question

Guten Abend

 

Ich m?chte gerne mit PHP ?ber meinen Mailserver (der zusammen mit Froxlor auf der selben Maschine funktioniert), Mails verschicken.

 

Dazu benutze ich PhpMailer, was auch ohne eine Anmeldung am Server prima funktioniert (Wenn ich ?ber denn Google Server mit einem Google Account senden will, muss sich das PHP Script erst anmelden.

 

Ist die erste Variante f?r einen Missbrauch gef?hrlich ?

Wie kann ich mich denn mit PHP am lokalen Mailserver anmelden ?

Irgendwie bekomme ich da eine Fehlermeldung

Hier mal das Script:

$mail = new PHPMailer;
$mail->SMTPDebug = 3;                                   // Enable verbose debug output
$mail->isSMTP();                                        // Set mailer to use SMTP
$mail->Host = ($row['mail_host']);                      // Specify main and backup SMTP servers
$mail->SMTPAuth = true;                                 // Enable SMTP authentication
$mail->Username = ($row['smtp_username']);              // SMTP username
$mail->Password = ($row['smtp_password']);              // SMTP password
$mail->SMTPSecure = ($row['smtp_security']);            // Enable TLS encryption, `ssl` also accepted
$mail->Port = ($row['smtp_port']);                      // TCP port to connect to
$mail->From = ($row['email']);                              
$mail->FromName = ($row['from_name']);
$mail->addAddress('empfanger@xxx.xx', 'Vorname Nachname');     // Add a recipient
$mail->isHTML(true);                                  // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body    = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
 
Und hier die Fehlermeldung im Browser:
SMTP connect() failed. Message could not be sent.Mailer Error: SMTP connect() failed.
 
Geht mein Vorhaben ?berhaupt ? 
Als Port habe ich 25 angegeben, Verbindung ist TLS
 
Danke f?r eure Hilfe
Gruss, Arby
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hallo d00p

 

Habe noch einen peinlichen Fehler meinerseits bemerkt.

Und zwar habe ich nicht bei der Domain selbst Email aktiviert, sondern beim User.

Habe das angepasst und nun passts soweit.

Bei $row['smtp_security'] hab ich entweder tls oder ssl stehen, wobei mir klar ist das ssl nicht geht, tls kenne ich nicht und geht auch nicht.

Lass ich diesen Parameter ganz weg, funktioniert es auch mit der Mail.

 

Gruss, Arby

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...