M
M
Mikeprosoft2010-10-08 11:32:45
PHP
Mikeprosoft, 2010-10-08 11:32:45

What is the best way to send notifications from php?

What is the best way to send letters: via mail() or external smtp (google/yandex)?

Notifications will be quite a lot. Probably every minute or more.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
W
witbier, 2010-10-08
@witbier

mail(). The function will kick sendmail, which will simply queue the message for later processing by a daemon (sendmail, qmail, postfix, you name it) and quickly return control to the application. And setting up an SMTP connection with a remote host like Yandex and Google is a rather slow operation, as practice shows.

A
Alex Shinkevich, 2010-10-08
@aleXoid

Add to the log, and then send by cron

S
shsmad, 2010-10-08
@shsmad

Through external it’s good, but you can run into a limit on the number of outgoing messages per unit of time (in particular, Google has it). It is better to use your mail server (if any). However, in this scenario, you can get into the spam list, with such and such a frequency.

K
Kir Shatrov, 2010-10-08
@RazoR_Empire

Make a notification pool, and a separate script that sorts and sends messages from the pool. So for sure nothing will be lost and there will be no slowness)

M
Mikeprosoft, 2010-10-08
@Mikeprosoft

the hoster also suggested that it is better to use mail (). if there really is such a big queue, I will make a pool

C
charon, 2010-10-10
@charon

in order not to spoil relations with spamlists, it's better to use XMPP and send messages to your jabber :) Jabber server can log certain messages.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question