0

I just installed the xampp version 1.8.3 and wanted to send a test mail (sendmail function) over a php script (PHP-Mailer class). This was formerly also no problem.

I configured the php.ini and sendmail.ini to set up my mail server data (tested with a gmx and a strato mail address) the same way i did it in the past.

But when i try to send a mail, i get a error message "Message could not be sent". The error log file told me, that the server replies that i am not using a ssl connection.

But i used the smtp port 465 or 587 in the php.ini and sendmail.ini (according to the FAQ of the provider).

Question: Do i need to install a special ssl certificate or something like this? I thought that i only have to tell sendmail to use ssl (or tls).

igi
  • 125
  • 1
  • 15

1 Answers1

0

You're confused about transports. If you're sending using sendmail, you're not using SMTP, and thus SSL and TLS are irrelevant, and php.ini settings will have no effect. It sounds like you need to configure your local mail server to use SSL for outbound - how exactly you do that is down to your mail server.

Synchro
  • 35,538
  • 15
  • 81
  • 104
  • Hey, thanks for your fast reply! Maybe I understand it wrong, but i thought the purpose of using the sendmail function is that you don't need a "real" mailserver. I configured it as shown in many forums (http://stackoverflow.com/questions/15965376/how-to-configure-xampp-to-send-mail-from-localhost) and in the past (before using ssl) it worked that way. – igi Nov 12 '14 at 20:36
  • Aha! *That* sendmail! OK, [as it says](http://glob.com.au/sendmail/), it's a fake mail server, so only an intermediate step. Essentially it's doing the same thing as PHPMailer's SMTP class, so you're better off (since you're already using PHPMailer) using that. Take a look at [this example code](https://github.com/PHPMailer/PHPMailer/blob/master/examples/gmail.phps) for how to send directly to an SMTP server with authentication and encryption. – Synchro Nov 12 '14 at 20:45
  • 1
    That's it! After fixing my code referring to your example code everything works fine! Thank you very much! – igi Nov 13 '14 at 16:29