search

Home  >  Q&A  >  body text

java - 异步方式发邮件的设计?

PHPzPHPz2893 days ago338

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-18 09:28:32

    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.


    reply
    0
  • 巴扎黑

    巴扎黑2017-04-18 09:28:32

    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

    reply
    0
  • 阿神

    阿神2017-04-18 09:28:32

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

    reply
    0
  • Cancelreply