java - 异步方式发邮件的设计?
PHPz
PHPz 2017-04-18 09:26:32
0
3
326
PHPz
PHPz

学习是最好的投资!

reply all(3)
刘奇

Because http is a response protocol, if you want to send emails asynchronously, it must be implemented by the server itself, not http itself.

In terms of design, for those with ample server resources, a server can be used as a mail server and the interface can be exposed to the outside world to send emails asynchronously.
Otherwise, you need to store the email and content to be sent (such as database, text file, redis, etc.), and then send it asynchronously through the following methods.
For Windows series servers, you can write services and use system tasks to implement them simply.
For Linux series servers, this can be achieved through corntiming, daemon processes, etc.


巴扎黑

Put a piece of data into the message table (including sendee, sending status, sending problem, sending type), create a task, scan the message table regularly, find unsent messages, send the message, and modify the status of the message table

阿神

Personally, I feel it’s a bit too complicated. Isn’t it possible to just open the thread and adjust it asynchronously?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template