0

I use Xampp, and i would like email send with phpmailer.

My error has issued:

Extension missing: openssl

Mailer Error: Extension missing: openssl

I made all settings in php.ini: ;extension=php_openssl.dll to extension=php_openssl.dll

and restart apache.

What is my problem? Thanks!!

---UPDATE----

It seems to have been solved in the OpenSSL problem. Now I get the following error message:

2018-03-15 09:24:02 Connection: opening to smtp.gmail.com:465, timeout=300, options=array() 2018-03-15 09:24:02 Connection: opened 2018-03-15 09:24:13 SERVER -> CLIENT: 2018-03-15 09:24:13 SMTP NOTICE: EOF caught while checking if connected 2018-03-15 09:24:13 Connection: closed SMTP Error: Could not connect to SMTP host. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

P Patrik
  • 1
  • 1
  • 3
    Have you really installed OpenSSL or only enabled an extension that might exist or not? Does phpinfo tell you that OpenSSL is working? – Nico Haase Mar 13 '18 at 13:02
  • Check: https://stackoverflow.com/questions/9466086/enabling-the-openssl-in-xampp – Alexey Chuhrov Mar 13 '18 at 13:05
  • In your php.ini find and change `extension_dir = "ext"` to something like this: `extension_dir = "c:/php710/ext"` – Nawin Mar 13 '18 at 13:06

1 Answers1

0

You can send mail from localhost with sendmail package , sendmail package is inbuild in XAMPP. So if you are using XAMPP then you can easily send mail from localhost.

for example you can configure C:\xampp\php\php.ini and c:\xampp\sendmail\sendmail.ini for gmail to send mail.

in C:\xampp\php\php.ini find extension=php_openssl.dll and remove the semicolon from the beginning of that line to make SSL working for gmail for localhost.

in php.ini file find [mail function] and change

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = my-gmail-id@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

Now Open C:\xampp\sendmail\sendmail.ini. Replace all the existing code in sendmail.ini with following code

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=my-gmail-id@gmail.com
auth_password=my-gmail-password
force_sender=my-gmail-id@gmail.com
Now you have done!! create php file with mail function and send mail from localhost.

PS: don't forgot to replace my-gmail-id and my-gmail-password in above code. Also, don't forget to remove duplicate keys if you copied settings from above. For example comment following line if there is another sendmail_path : sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe" in the php.ini file

Also remember to restart the server using the XAMMP control panel so the changes take effect.

For gmail please check https://support.google.com/accounts/answer/6010255 to allow access from less secure apps.

vikalp
  • 330
  • 2
  • 9
  • This may be true, but it has nothing to do with sending email using SSL with PHPMailer, which is what the question is about. – Synchro Mar 13 '18 at 13:22