Mail sending method and device, computer equipment and storage medium
By obtaining and sorting the priority information corresponding to the mail domain name and sending emails in sequence using the preset mail engine, the problem of difficulty in taking into account the success rate and cost of emails in the prior art is solved, and efficient and low-cost mail delivery is achieved.
Patent Information
- Application Number
- CN202311840921.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-06-27
AI Technical Summary
The prior art is difficult to take into account both the success rate and the cost of email delivery, and traditional methods require purchasing expensive dedicated channels or increasing hardware costs to increase mail delivery rates.
By obtaining the priority information corresponding to the email domain name of the email to be sent, sorting according to the sending success rate of multiple preset mail engines, the preset mail engine sends the emails in sequence until they are delivered successfully.
This improves the delivery rate and reduces the cost of mail engine acquisition, and multiple mail engines can be integrated on the same host, taking into account both the success rate and cost of mail delivery.
Smart Images

Figure CN120223667A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of email communication, and particularly to an email sending method, apparatus, computer device, and storage medium. Background Art
[0002] With the development and progress of the Internet, email services have become very popular in various fields. As an essential part of daily communication, email plays a very important role. However, as an instant messaging service, when sending an email, there may be a problem that the mailbox is identified as a spam mailbox by the server corresponding to the recipient mailbox of some of the notified recipients, and then blacklisted by the server, resulting in the inability to send the email to the notified recipient's mailbox.
[0003] In traditional methods, it is often necessary to purchase a dedicated channel provided by an email service provider and perform email delivery based on a fixed IP with a relatively high reputation provided by the dedicated channel. However, the maintenance cost of the dedicated channel is high and the purchase cost is expensive. Alternatively, in traditional methods, multiple email sending hosts can also be obtained. When one host attempts to send and fails, another host is switched to continue the attempt until the sending is successful. Although this method does not require paying fees to the email service provider, it will increase the hardware cost.
[0004] In view of the problem in the traditional technology that it is impossible to balance the email sending success rate and cost, no effective solution has been proposed yet. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide an email sending method, apparatus, computer device, and storage medium that balance the email sending success rate and cost.
[0006] In a first aspect, in the present embodiment, an email sending method is provided, and the method includes:
[0007] Obtain priority information corresponding to the email domain name of the email to be sent, where the priority information is obtained based on the sending success rates of historical emails sent by multiple preset email engines, and the addresses of the historical emails include the email domain name;
[0008] According to the priority order of each of the preset email engines in the priority information, sequentially obtain each of the preset email engines to send the email to be sent until the email to be sent is successfully sent.
[0009] In some of the embodiments, after sequentially obtaining each of the preset email engines to send the email to be sent until the email to be sent is successfully sent, it includes:
[0010] Obtain a first email engine that successfully sends the email to be sent;
[0011] Increase the priority of the first mail engine in the priority information.
[0012] In some embodiments, the obtaining of the priority information corresponding to the mail domain name of the mail to be sent includes:
[0013] Count the sending success rate of each of the preset mail engines for sending the historical mails within a first time period;
[0014] Sort the preset mail engines according to the sending success rate of the preset mail engines to obtain the priority information, wherein the sending success rate of the preset mail engine is positively correlated with the priority order of the preset mail engine.
[0015] In some embodiments, the obtaining of the priority information corresponding to the mail domain name of the mail to be sent includes:
[0016] Obtain the sending success rate of each of the preset mail engines for sending the historical mails within a second time period;
[0017] If the sending success rates of each of the preset mail engines for sending the historical mails within the second time period are equal, then obtain a second mail engine that has sent the historical mails within a third time period; wherein the second time period is later than the third time period;
[0018] Obtain the priority information based on the sending success rate of the second mail engine for sending the historical mails within the third time period.
[0019] In some embodiments, before the obtaining of the priority information corresponding to the mail domain name of the mail to be sent, the method further includes:
[0020] Determine whether there is priority information corresponding to the mail domain name of the mail to be sent;
[0021] If not, obtain a third mail engine corresponding to the mail domain name, and send the mail to be sent based on the third mail engine.
[0022] In some embodiments, sending the mail to be sent based on the third mail engine includes:
[0023] Obtain the similarity between the engine domain names of multiple third mail engines and the mail domain name;
[0024] Based on the order from high to low of the similarity, sequentially obtain the third mail engines to send the mail to be sent until the mail to be sent is successfully sent.
[0025] In some of these embodiments, determining whether the email to be sent is successfully sent includes:
[0026] After sending the email to be sent to the email server corresponding to the email domain name, obtaining the actual identifier generated by the email server based on the email protocol;
[0027] If the actual identifier is a preset identifier, it is determined that the email to be sent is successfully sent; if the identifier is not the preset identifier, it is determined that the email to be sent fails.
[0028] In a second aspect, in the present embodiment, an email sending device is provided, and the device includes:
[0029] An obtaining module, configured to obtain priority information corresponding to the email domain name of the email to be sent, where the priority information is obtained according to the sending success rate of historical emails including the email domain name sent by multiple preset email engines;
[0030] A sending module, configured to sequentially obtain each of the preset email engines to send the email to be sent according to the priority order of each preset email engine in the priority information until the email to be sent is successfully sent.
[0031] In a third aspect, in the present embodiment, a computer device is provided, including a memory and a processor, where the memory stores a computer program, and when the computer program is executed, the email sending method described in the first aspect above is implemented.
[0032] In a fourth aspect, in the present embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the email sending method described in the first aspect above is implemented.
[0033] The above email sending method, device, computer device, and storage medium switch to send emails through multiple preset email engines, ensuring that the emails can be successfully sent to the recipient's mailbox, improving the email delivery rate. At the same time, the cost of obtaining email engines is low, and multiple email engines can be integrally arranged on the same host, taking into account the email sending cost while ensuring the delivery rate. Description of the Drawings
[0034] Figure 1 It is a hardware structure block diagram of a terminal for the email sending method in an embodiment;
[0035] Figure 2 It is a flowchart of the email sending method in an embodiment;
[0036] Figure 3 It is a schematic diagram of an email sending manager in an embodiment;
[0037] Figure 4 Schematic diagram of the process for a mail - sending scheduler to send notification emails in an embodiment;
[0038] Figure 5 Block diagram of the structure of a mail - sending device in an embodiment;
[0039] Figure 6 Internal structure diagram of a computer device in an embodiment. Detailed implementation manners
[0040] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0041] In traditional methods, to improve the success rate of mail sending, dedicated channels provided by mail service providers are often used to send mails. Among them, the dedicated channel uses a fixed IP with a relatively high reputation and intelligent network data services for mail delivery, and the intelligent network data services in the dedicated channel prevent spam emails from appearing in the fixed IP space, so as to achieve the effect of discovering and eliminating "trap accounts". Moreover, the dedicated channel will send warm - up emails to establish a lot of historical records of sending high - quality emails, so as to establish a good reputation among Internet service providers. Therefore, the probability of the dedicated channel's mail delivery being blacklisted will be greatly reduced, thus ensuring the success rate of mail sending. However, choosing this method requires paying expensive fees for the dedicated channel to the mail service provider. Another traditional solution is to provide multiple mail - sending hosts through a cluster. When one host fails to send successfully, another host is switched to continue the attempt until the sending is successful. Although this solution does not require paying fees to the mail service provider, it will increase the hardware cost. Therefore, traditional technologies face the problem of being unable to balance the success rate of mail sending and cost. Based on this problem, the following embodiments of the mail - sending method are provided.
[0042] In one of the embodiments, the method embodiment provided in this embodiment can be executed on a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is the hardware structure block diagram of the terminal of the mail - sending method according to an embodiment of the present application. As Figure 1 shown, the terminal may include one or more ( Figure 1 only one is shown in Figure 1The structure shown is only illustrative and does not limit the structure of the above terminal. For example, the terminal may further include more or fewer components than those shown in Figure 1 or have a different configuration from that shown in Figure 1 .
[0043] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the web page translation method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.
[0044] The transmission device 106 is used to receive or send data via a network. The above network includes the wireless network provided by the communication provider of the terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0045] The email sending method provided by the embodiments of the present application can be applied to an application environment such as Figure 1 shown. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0046] Step S201, obtain priority information corresponding to the email domain name of the email to be sent, where the priority information is obtained according to the sending success rates of historical emails sent by multiple preset email engines, and the addresses of the historical emails include the email domain name.
[0047] Among them, the email address consists of a username and a domain name. Taking the email address name@domain.com as an example, name is the username and domain.com is the domain name. The address of the historical email contains the email domain name of the email to be sent. For example, if the email domain name of the email to be sent is domain.com, then the address of the historical email includes domain.com. Optionally, in the sent emails, obtain the emails that contain the email domain name of the email to be sent, and use the obtained emails as historical emails.
[0048] Among them, the mailbox sending engine is a program for sending emails. Different mailbox sending engines realize the sending of emails through different email service providers respectively. The priority information records the priority order of selection of multiple preset email engines when sending the email domain name containing the email to be sent. In one embodiment, the priority information here can be a list recording the priority order, or a code composed of a section of numbers and / or characters, and this code can reflect the priority order of selection of multiple preset email engines. Optionally, obtain the sending success rates of multiple preset email engines for sending historical emails. The higher the sending success rate of the preset email engine, the higher the priority order; vice versa, the same reason applies and will not be elaborated.
[0049] Step S202: According to the priority order of each preset email engine in the priority information, obtain each preset email engine in turn to send the email to be sent until the email to be sent is successfully sent.
[0050] Among them, if the higher the sending success rate of the preset email engine for sending historical emails, the higher its priority order, then it is preferred to obtain the preset email engine with a higher priority order. On the contrary, if the higher the sending success rate of the preset email engine for sending historical emails, the lower its priority order, then it is preferred to obtain the preset email engine with a lower priority order.
[0051] Optionally, select the preset email engine A with the highest priority order according to the priority information to send the email to be sent. If the preset email engine A successfully sends the email, the email sending ends. If the preset email engine A fails to send the email, then obtain the preset email engine B with the highest priority order except the preset email engine A in the priority information, and send the email to be sent through the preset email engine B. Repeat the above steps of judging and obtaining the preset email engine until the email to be sent is successfully sent.
[0052] In the above email sending method, when a preset email engine fails to send an email, a new preset email engine can be used to send the email. By switching the preset email engine to send the email, it is ensured that the email can be successfully sent to the recipient's mailbox, improving the email delivery rate. At the same time, because the acquisition cost of the email engine is low and multiple email engines can be integrally set on the same host, compared with the method of paying expensive fees to purchase a dedicated channel provided by an email service provider or the method of purchasing multiple hosts to simulate different IPs to send emails, the implementation cost of using a preset email engine to send the email to be sent is low, thus solving the problem of being unable to balance the email sending success rate and cost.
[0053] Moreover, in the above embodiment, since the email domain name in the address of the historical email is the same as the email domain name of the email to be sent, the email servers for receiving the historical email and the email to be sent are the same. If the sending success rate of the historical email of the preset email engine is high, it can be determined that there is a relatively high probability that the preset email engine will not be blocked by the email server corresponding to the email domain name when sending an email. Therefore, in the above embodiment, the priority information is generated according to the sending success rate of the historical email, and the preset email engine is selected to send the email to be sent based on the priority information, so that the email can be successfully sent in a relatively short time.
[0054] To further shorten the time for the email to be sent to be successfully sent, the priority information can be adjusted in real time. In one embodiment, after successively obtaining the preset email engines to send the email to be sent until the email to be sent is successfully sent, it includes: obtaining the first email engine that successfully sends the email to be sent; increasing the priority of the first email engine in the priority information.
[0055] The specific increase strategy can be formulated based on user requirements. Optionally, after the first email engine sends the email successfully, the first email engine can be increased so that it becomes the email engine with the highest priority. Or, after the first email engine sends the email successfully, the priority of the first email engine can be increased by a specified number of ranks. For example, after the first email engine successfully sends an email to be sent containing the email domain name each time, its priority is increased by one level.
[0056] In this embodiment, when the first email engine successfully sends the email to be sent, it can be known that the first email engine is not blocked by the email server corresponding to the email domain name. When there is a new requirement to send an email including the email domain name, compared with other email engines that have failed to send, the first email engine has a relatively high probability of successfully sending the email. By increasing the priority information of the first email engine and preferentially using the first email engine to send the email, the time required to successfully send the email can be shortened.
[0057] In some of these embodiments, obtaining priority information corresponding to the email domain name of the email to be sent includes: counting the sending success rates of historical emails sent by each preset email engine within a first time period; sorting the preset email engines according to the sending success rates of the preset email engines to obtain priority information, where the sending success rate of the preset email engine is positively correlated with the priority order of the preset email engine. The first time period can be determined based on user requirements. For example, the first time period can be the day when the sending success rate is counted, or the current week when the sending success rate is counted, etc. Optionally, the higher the sending success rate of the preset email engine for sending historical emails within the first time period, the higher the priority order; vice versa. If there are multiple preset email engines with the same sending success rate of historical emails within the first time period, the same priority can be set for the preset email engines with the same sending success rate of historical emails when generating the priority information.
[0058] Alternatively, to avoid being unable to distinguish the acquisition order of these preset email engines, the sending success rates of historical emails sent by the preset email engines within a third time period can also be obtained to obtain priority information. In one of the embodiments, obtaining priority information corresponding to the email domain name of the email to be sent includes: obtaining the sending success rates of historical emails sent by each preset email engine within a second time period; if the sending success rates of historical emails sent by each preset email engine are equal within the second time period, obtaining a second email engine that has sent historical emails within the third time period; where the second time period is later than the third time period; obtaining priority information based on the sending success rate of historical emails sent by the second email engine within the third time period. The second time period and the third time period can be determined based on user requirements, as long as the limitation that the second time period is later than the third time period is satisfied.
[0059] Optionally, if the sending success rates of historical emails sent by each preset email engine are equal and all 0 within the second time period, it is determined that no preset email engine has sent historical emails containing the email domain name within the second time period. Obtain a second email engine that has sent historical emails within the third time period. The higher the sending success rate of historical emails sent by the second email engine, the higher the priority order.
[0060] In one of the embodiments, before obtaining priority information corresponding to the email domain name of the email to be sent, the method further includes: determining whether there is priority information corresponding to the email domain name of the email to be sent; if not, obtaining a third email engine corresponding to the email domain name and sending the email to be sent based on the third email engine.
[0061] When selecting a third mail engine to send the mail to be sent based on the mail domain name, the mail engine whose engine domain name includes the mail domain name of the mail to be sent can be used as the third mail engine. Alternatively, the mail engine whose similarity between the engine domain name and the mail domain name of the mail to be sent is greater than a specified threshold can also be used as the third mail engine.
[0062] Optionally, sending the mail to be sent based on the third mail engine includes: obtaining the similarity between the engine domain names and the mail domain names of multiple third mail engines; sequentially obtaining third mail engines to send the mail to be sent in the order of decreasing similarity until the mail to be sent is successfully sent.
[0063] Among them, the similarity between the engine domain name and the mail domain name of the third mail engine refers to the degree of repetition of characters between the engine domain name and the mail domain name. The higher the similarity between the engine domain name and the mail domain name of the third mail engine, the greater the probability that the mail server managing the third mail engine and the mail server used to receive the mail to be sent belong to the same mail server. Generally, the instantaneity and delivery rate of communication between the same mail servers are often greater than those of mail communication between different mail servers. Therefore, in the absence of priority information corresponding to the mail domain name of the mail to be sent, in this embodiment, the third mail engine is selected based on the mail domain name to send the mail to be sent, so that the mail to be sent can be successfully delivered.
[0064] In an alternative embodiment, when the mail domain name is the same as the domain name of the mail engine, the similarity is the highest. Here, the similarity between the mail domain name and the domain name of the mail engine means that although the domain names are different, they are often the same in essence, only due to differences in their representation forms. For example, @gmail.com represents the domain name of Google Mail, and @googlemail.com also represents the domain name of Google Mail, so @gmail.com and @googlemail.com are similar. Similarly, the similarity here does not mean similarity in the characters of the mail domain name. For example, @amail.com is similar to @gmail.com in characters, but they are not the same mail domain name in essence, so these two domain names do not constitute similarity. Secondly, the mail engine with the same second-level domain name as the mail domain name. The one with the lowest similarity is the mail engine that is completely different from the mail domain name.
[0065] In an alternative embodiment, the mail engine with the same domain name as the mail domain name has the highest similarity; the mail engine similar to the mail domain name has the second highest similarity; the mail engine with the same second-level domain name as the mail domain name has the third highest similarity; the mail engine that is completely different from the mail domain name has the lowest similarity.
[0066] In one embodiment, determining whether a mail to be sent is successfully sent includes: after sending the mail to be sent to a mail server corresponding to the mail domain name, obtaining an actual identifier generated by the mail server based on the mail protocol; if the actual identifier is a preset identifier, determining that the mail to be sent is successfully sent; if the identifier is not a preset identifier, determining that the mail to be sent fails to be sent.
[0067] Among them, the mail protocol includes but is not limited to smtp (Simple Mail Transfer Protocol) and pop3 (Post Office Protocol Version 3). Optionally, the preset mail engine includes a mail sending function and a mail listening function. Based on its mail listening function, the preset mail engine obtains the actual flag generated by the mail server of the mail to be sent through the existing mail protocol, and determines whether the mail to be sent is successfully sent based on the actual flag.
[0068] In one embodiment, when it is necessary to send mails to multiple notified persons for message notification, since the notification mail has characteristics such as a fixed content template, no need to reply, and a high sending frequency, these characteristics are also one of the characteristics of advertising mails. Therefore, the notification mail is very likely to be recognized as a junk mail by the server corresponding to the recipient mailbox of some notified persons, and then be blacklisted by the server, resulting in the inability to send the notification mail to the notified person's mailbox.
[0069] To ensure that each notification mail can be successfully delivered to the target mailbox every time Figure 3 a mail sending manager is provided. The mail sending manager can obtain the notification mail sending task through the mail sending queue. At the same time, it has N different mailbox sending engines, where N is a positive integer. The mail sending manager can implement the sending of the notification mail by switching the mailbox sending engines.
[0070] Among them, the email address consists of a username and a domain name. For example: name@domain.com, where name is the username and domain.com is the domain name. The domain name usually consists of an identification name and a second-level domain name: for example: name@domain.com, where domain is the identification name and com is the second-level domain name. The mailbox sending engine can be used to support the sending of mails with different domain names, but each time the mailbox sending engine only supports the sending of one mailbox account and does not support the simultaneous sending of multiple mailbox accounts.
[0071] In the email sending manager, the process of the mailbox sending engine sending an email is as follows: After the email engine delivers a notification email to the email server, the mailbox sending engine starts an email delivery monitoring program and monitors the email service provider through the POP3 protocol to obtain the email delivery status, and judges whether the email is sent successfully according to the email delivery status. Among them, the method of obtaining the delivery status for each email server is different. For the convenience of understanding, taking the preset identifier for indicating successful email sending as "Delivery" as an example, in the case where the mailbox status is "Delivery", it is judged that the email has been delivered to the target mailbox corresponding to the notification email; in the case where the mailbox status is "Bounce", it is judged that the email has been blacklisted or the email domain name has been blacklisted, and the email has not been delivered to the target mailbox corresponding to the notification email. Each time it is judged whether the email is sent successfully, the mailbox sending record of this time is recorded in the database, and the sending success rate when the email engine sends the email domain name is obtained statistically
[0072] Among them, the email sending queue can be implemented through an email sending scheduler. Specifically, in the case where there is a notification email to be sent, the notification email content and the recipient's email address are pushed into the email sending queue of the email sending scheduler
[0073] The email sending scheduler is used to select the corresponding email engine to send the email according to the domain name of the email to be sent. Alternatively, the email sending scheduler can also select the corresponding email engine to send the email according to the domain name of the email to be sent and the statistical results of the database Figure 4 A schematic flow chart of the email sending scheduler sending a notification email is provided, as Figure 4 shown, including the following steps
[0074] S401. When the email sending scheduler is initialized, it preferentially selects an email engine with the same or similar domain name as the email to be sent to send the notification email. Optionally, when the domain name of the email to be sent is @gmail.com, the email engine with the same domain name @gmail.com and the email engine with a similar domain name @googlemail.com are selected
[0075] Optionally, when there are multiple email engines with the same or similar domain name as the email to be sent, one of them is randomly selected to send the email when sending the email
[0076] S402. When there is no email engine with the same or similar domain name as the email to be sent, or when the notification email cannot be successfully sent based on the email engine with the same or similar domain name as the email to be sent, select the email engine with the same second-level domain name as the email to be sent. Optionally, when the domain name of the email to be sent is @aaa.de, the email engine with the second-level domain name "de" is selected
[0077] Optionally, when there are multiple mail engines with the same second-level domain name as the email to be sent, randomly select one of the mail engines to send the email.
[0078] S403, if a mail engine meeting the requirements cannot be found according to step S402, randomly select a mail engine to send the notification email.
[0079] Exemplarily, taking the email domain name of the notification email as @gmail.com and the mail engines that can be selected by the email sending scheduler as A, B, and C as examples. If the email domain names of the three mail engines A, B, and C are not the same as the email domain name "@gmail.com", not similar to the email domain name "@gmail.com", and the second-level domain names are also different, then in the case of randomly selecting a mail engine, the sending times of the three mail engines A, B, and C have a small difference. Table 1 lists the situations of sending notification emails through the three mail engines A, B, and C when there is no mail engine with the same email domain name as "@gmail.com", not similar to the email domain name "@gmail.com", and the second-level domain names are also different. During the sending process, when sending an email, first randomly select one of the three mail engines A, B, and C for sending. If the email sending by this mail engine fails, then select any one of the remaining 2 mail engines for email sending. It should be known that in the actual process, the number of mail engines can be more than three or less than three.
[0080] Table 1
[0081] Mail domain name Mail engine Number of successes Number of failures Number of sends Success rate @gmail.com A 150 13 163 92.02% @gmail.com B 127 3 130 97.69% @gmail.com C 136 18 154 88.31%
[0082] S404, count the number of successful and failed email sends for each email domain name in different mail engines on the same day.
[0083] When sending an email, select the corresponding mail engine to send the email according to step S401. If a mail engine meeting the conditions cannot be selected according to step S401, or if the mail engine selected according to step S401 fails to send the email successfully, then select the corresponding mail engine to send the email according to step S402; if a mail engine meeting the conditions cannot be selected according to step S402, or if the mail engine selected according to step S402 fails to send the email successfully, then select the corresponding mail engine to send the email according to step S403. When multiple emails need to be sent, each email selects a mail engine and sends the email according to the regulations from step S401 to step S403.
[0084] S405. When sending the notification email on the second day, according to the email sending success rates of the email domain name of the previous day's notification email in different email engines, select the email engines in the order from the highest to the lowest email sending success rate to send the notification email until the notification email is successfully sent, and then stop obtaining the email engines.
[0085] Exemplarily, when sending the notification email with the domain name @gmail.com, the email sending success rates of the @gmail.com domain name in different email engines on the previous day are shown in Table 1. Then, the selection order of the email engines from the highest to the lowest priority is: Engine B, Engine A, Engine C. Specifically, when sending the notification email with the domain name @gmail.com, each time, give priority to selecting Engine B to send the notification email. If Engine B fails, select Engine A to send the notification email. If Engine A fails, select Engine C to send the notification email.
[0086] Alternatively, when sending the notification email with the domain name @gmail.com, first select the email engines in the order from the highest to the lowest email sending success rate to send the notification email. If the email engine with a high email sending success rate fails to send, while the email engine with a low email sending success rate sends successfully, then set the email engine that successfully sends the notification email as the email engine with the highest priority. Optionally, the selection order of the email engines from the highest to the lowest priority is: Engine B, Engine A, Engine C. First, send the notification email through Engine B. In the case where Engine B fails to send once, select Engine A to send the notification email. If Engine A successfully sends the notification email, when sending other notification emails with the domain name @gmail.com subsequently, give priority to selecting Engine A to send the notification email.
[0087] S406. If in step S405, no corresponding email engine can be found according to the email domain name, that is, this email domain name is sent for the first time, execute steps S401 to S403.
[0088] S407. Statistically count the number of successful and failed email sends of each email domain name in different email engines on the same day. Exemplarily, taking the email domain name of the notification email as @gmail.com as an example, Table 2 can be statistically obtained on the second day.
[0089] Table 2
[0090]
[0091]
[0092] After the second day, the email sending scheduler can select an email engine with reference to the steps of S405 to S407. Exemplarily, the method for selecting an email engine when sending emails on the third day is taken as an example for illustration. When sending emails on the third day, in the case where no email engine has successfully sent a notification email with the email domain name of @gmail.com and there is an email sending statistical result for the email domain name of @gmail.com on the previous day, the selection priority of the email service engine can be determined based on the email sending statistical result of @gmail.com. When sending emails on the third day, in the case where no email engine has successfully sent a notification email with the email domain name of @gmail.com and no email with the email domain name of @gmail.com was sent on the previous day, the selection priority of the email service engine obtained on the previous day can be retained, that is, the email is sent according to the priority of the email engine determined by the number of successful and failed sends of this domain name on the first day. When sending emails on the third day, in the case where there is already an email engine that has successfully sent a notification email with the email domain name of @gmail.com, the selection priority of the email service engine is determined according to the real-time statistical result of the email engine sending success rate on the third day. Similarly, after the third day, the selection of the email engine can also be implemented based on the above method.
[0093] This embodiment provides a notification email sending solution with low cost, high success rate and low cost. It neither requires applying for paid services such as dedicated channels, nor requires configuring multiple hardware sending devices to simulate different IPs for sending, and can solve a series of problems of the email box being blacklisted. In addition, when sending notification emails by switching the email service engine, it can also solve problems such as sending failure caused by unstable network during sending, the email box used for sending notification emails being wrongly operated by customers into the blacklist, some domestic email servers not being able to find due to the variety of foreign email domain names, and some email addresses containing special characters not being allowed by a few servers.
[0094] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps. For example, during the execution of steps S401 to S403, step S404 can be synchronously executed to achieve real-time statistics of the email sending success rate.
[0095] Based on the same inventive concept, an embodiment of the present application further provides a mail sending device for implementing the mail sending method involved above. The solution for solving the problem provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in the embodiment of the mail sending device provided below can refer to the limitations on the mail sending method in the above text, and will not be elaborated here.
[0096] In one embodiment, as Figure 5 shown, a mail sending device is provided, including: an acquisition module and a sending module, where: the acquisition module is used to acquire priority information corresponding to the mail domain name of the mail to be sent, and the priority information is obtained according to the sending success rate of historical mails containing the mail domain name sent by multiple preset mail engines; the sending module is used to sequentially acquire each of the preset mail engines to send the mail to be sent according to the priority order of each preset mail engine in the priority information until the mail to be sent is successfully sent.
[0097] Each module in the above mail sending device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in the form of hardware or be independent of it, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above respective modules.
[0098] In one embodiment, a computer device is provided. This computer device can be a server, and its internal structure diagram can be as Figure 6 shown. This computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of this computer device is used to provide computing and control capabilities. The memory of this computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of this computer device is used to store priority information. The input / output interface of this computer device is used for exchanging information between the processor and external devices. The communication interface of this computer device is used for communicating with an external terminal through a network connection. When the computer program is executed by the processor, it implements a mail sending method.
[0099] Those skilled in the art can understand, Figure 6The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0100] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0101] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0102] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0103] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0104] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for sending emails, characterized in that, The method includes: Obtaining priority information corresponding to the mail domain name of the mail to be sent, where the priority information is obtained based on the sending success rates of multiple preset mail engines for sending historical mails, and the addresses of the historical mails include the mail domain name; According to the priority order of each preset mail engine in the priority information, successively obtaining each preset mail engine to send the mail to be sent until the mail to be sent is successfully sent.
2. The method according to claim 1, wherein After successively obtaining each preset mail engine to send the mail to be sent until the mail to be sent is successfully sent, it includes: Obtaining the first mail engine that successfully sends the mail to be sent; Increasing the priority of the first mail engine in the priority information.
3. The method according to claim 1, wherein The obtaining of the priority information corresponding to the mail domain name of the mail to be sent includes: Counting the sending success rates of each preset mail engine for sending the historical mails within a first time period; Sorting the preset mail engines according to the sending success rates of the preset mail engines to obtain the priority information, where the sending success rate of the preset mail engine is positively correlated with the priority order of the preset mail engine.
4. The method according to claim 1 or 3, characterized in that, The obtaining of the priority information corresponding to the mail domain name of the mail to be sent includes: Obtaining the sending success rates of each preset mail engine for sending the historical mails within a second time period; If the sending success rates of each preset mail engine for sending the historical mails within the second time period are equal, then obtaining a second mail engine that has sent the historical mails within a third time period, where the second time period is later than the third time period; Obtaining the priority information based on the sending success rate of the second mail engine for sending the historical mails within the third time period.
5. The method according to claim 1, characterized in that Before obtaining the priority information corresponding to the mail domain name of the mail to be sent, the method further includes: Judging whether there is priority information corresponding to the mail domain name of the mail to be sent; If not, obtaining a third mail engine corresponding to the mail domain name, and sending the mail to be sent based on the third mail engine.
6. The method according to claim 5, characterized in that Sending the mail to be sent based on the third mail engine includes: Obtaining the similarity between the engine domain names of multiple third mail engines and the mail domain name; Based on the order from high to low of the similarity, successively obtaining the third mail engines to send the mail to be sent until the mail to be sent is successfully sent.
7. The method according to claim 1, wherein Judging whether the mail to be sent is successfully sent includes: After sending the mail to be sent to the mail server corresponding to the mail domain name, obtaining the actual identifier generated by the mail server based on the mail protocol; If the actual identifier is a preset identifier, judging that the mail to be sent is successfully sent; if the identifier is not the preset identifier, judging that the mail to be sent fails.
8. A mail sending device, characterized in that, The device includes: An obtaining module, configured to obtain priority information corresponding to the mail domain name of the mail to be sent, where the priority information is obtained based on the sending success rates of multiple preset mail engines for sending historical mails including the mail domain name; A sending module, configured to sequentially obtain each of the preset mail engines according to the priority order of each of the preset mail engines in the priority information, and send the mail to be sent until the mail to be sent is successfully sent.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.