A
A
astrotrain2016-01-20 14:39:41
PHP
astrotrain, 2016-01-20 14:39:41

Is it possible to determine if sending emails on the server (PHP) is working?

How to check if it is possible to send emails from the server or if this feature is disabled? Simply checking for the existence of the mail function is not good, because it can exist and the send won't work anyway. Or if the path to the sendmail is not empty, then everything works?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nazar Mokrinsky, 2016-01-20
@astrotrain

Just send a test email. There can be many different configurations, and you won’t know for sure except how to send a letter. Therefore, sending a test letter is usually available in the settings of services / systems that work with mail.

L
Lander, 2016-01-21
@usdglander

The first thing that comes to mind:

if (function_exists(mail)) {
  //Отправка писем возможна
}

Not sure if it will work, but you can try

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question