U
U
ufaloony2017-01-07 22:25:41
Email
ufaloony, 2017-01-07 22:25:41

How to correctly send email from the site for certain user actions?

Good afternoon!
There is a site where users register, buy and activate services, recover passwords, etc. Now we have implemented sending letters (notifications) to users' emails during such actions on the site using the mail() function. The hoster has a limit on sending email ....pcs/month.
How to organize the sending of letters from the site so that there are no such restrictions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Astrikov, 2017-01-19
@ufaloony

Use transactional mail services. Some have ready-made libraries for integration, but usually everything is quite easy to integrate without libraries.
bash integration example:

curl 'http://api.mailhandler.ru/message/send/' \
    -X POST \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -H 'X-Secure-Token: <YOUR API KEY>' \
    -d '{"from": "[email protected]", "to": ["[email protected]"], "subject": "Hello world!", "html_body": "<html><body>Hello dear user.</body></html>"}'

Many services also allow you to create templates for transactional emails and then reuse them when sending, replacing only the context variables of the email.
In addition, you don’t have to think about how to properly format the letter so that it doesn’t get into spam, how to inline styles in the letter, how to track whether the letter reached the addressee, whether he followed the link, etc.

C
CityCat4, 2017-01-07
@CityCat4

- bash the hoster to remove the restriction
- change the host
- buy VDS, set up a server there and send letters from your server

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question