Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the method for prompting email attachment information provided in the embodiment of the present invention is mainly applied to the case where a terminal using an email client sends an email, where the terminal mentioned in the embodiment of the present invention includes, but is not limited to, various mobile terminals such as a mobile phone, a personal digital assistant PDA, a smart phone or a handheld portable computer, which have the function of sending and receiving an email, and the terminal may further include a fixed terminal such as a fixed station or a computer.
For ease of understanding, the working principle of the email client is first briefly described below:
assuming that the two mailbox accounts are lisina.com and wangwushu.com, the process of sending and receiving mails between the two mailboxes is shown in fig. 1, wherein a solid arrow represents a process of sending a mail from the lisina.com account to the wangwushu.com account, and a dotted arrow represents a process of sending a mail from the wangwushu.com account to the lisina.com account. Com accounts, the links involved in sending a piece of mail to receiving a piece of mail are specifically explained below by analyzing the process of sending mail from lisina.
Com, the user edits the mail in the interface and clicks the send button, and then the Outlook establishes network connection with the SMTP server of sina, and logs in with lisi's user name and password, and sends the mail to the SMTP server of sina using the SMTP protocol.
Secondly, after receiving the e-mail submitted by lisina.com, the SMTP server of sina judges whether the mail address of the receiver belongs to the administration range of the SMTP server according to the address suffix of the receiver, if so, the mail is directly stored in the mailbox of the receiver, otherwise, the SMTP server of sina inquires the domain name MX record represented by the mail address suffix (sohu.com) of the receiver from the DNS server so as to obtain the SMTP server information of the sohu, and then establishes connection with the SMTP server of the sohu and sends the mail to the SMTP server of the sohu by adopting an SMTP protocol.
After receiving the e-mail sent by sina's SMTP server, the sohu SMTP server also determines whether the e-mail belongs to the jurisdiction of the SMTP server according to the address of the recipient, and if so, directly stores the e-mail in the mailbox of the recipient, otherwise (this will not happen generally), the sohu SMTP server may continue to forward the e-mail, or may discard the e-mail.
And fourthly, a user with the wangwushu.com account establishes network connection with a POP3/IMAP server of the sohu through a mail client program (here, Outlook Express is also assumed), and after logging in with the username and the password of wangwu, whether a new mail exists in the wangwushu.com mailbox can be checked through a POP3 or an IMAP protocol, and if the mail exists in the mailbox, the mail in the mailbox can be read through the POP3 or the IMAP protocol.
The process of sending a mail to the lisina.com account by the wangwushu.com account, which is partially indicated by a dotted line, is similar to the process of sending a mail to the wangwushu.com account by the lisina.com account, and is not described herein again.
It can be seen from the foregoing process of sending email that, when using an email client to send and receive email, the email server is only used to perform background operations, and the foreground user interface is provided by the email client software, that is, what contents are specifically displayed on the user interface is determined by the email client software. This is different from sending and receiving mail directly on a web page, and when sending and receiving mail directly on a web page, the user interface is provided by the mail server, so that what contents are specifically displayed on the user interface is also determined by the mail server.
Referring to fig. 2, the method for prompting email attachment information provided by the embodiment of the present invention includes the following steps:
s201: acquiring and storing an attachment size threshold value needing to be prompted through a sending server;
it should be noted that, in the method provided in the embodiment of the present invention, the execution subjects of each step are all email clients. Since the limitation of the attachment size may be different for different servers and the limitation of the attachment size may also be different for different users by the same server, an attachment size threshold that needs to be prompted needs to be obtained first.
S202: when a user creates a mail, acquiring the size of an attachment added by the user;
the size of the attachment can be known at the same time when the user selects the attachment, and if the user adds a plurality of attachments in the same mail, the sum of the sizes of the attachments is known. The attachment is usually some video, audio, picture or document files stored in the system, and the system stores the attributes of the files when storing the files, wherein the size of the file is used as one basic attribute of the file and is stored in the system, so that the size of the attachment can be conveniently known by reading the attributes of the file as the attachment.
S203: and before the created mail is not sent, when the size of the attachment added by the user exceeds the threshold value, prompting the user that the mail cannot be sent.
Therefore, if the user adds the attachment in the mail, before the user clicks the sending button, the embodiment of the invention can judge whether the sending is failed probably because the attachment is overlarge, and if so, the user can be prompted that the mail cannot be sent. In this way, since the transmission has not been clicked yet, the user can find the problem in time without waiting until the transmission is clicked.
Of course, if only the mail is prompted to be sent, the user may not know the reason for the failure to send, and only needs to search the reason by himself, which requires the user to spend some time for self-thinking and operation. Therefore, while the embodiment of the present invention prompts that the email cannot be sent, the embodiment of the present invention may also prompt the user that the reason why the email cannot be sent is that the attachment is too large, for example, the following prompts may be given: the attachment is too large, the mail cannot be normally sent, and the like. Thus, after obtaining the information, the user can immediately know what means should be used to avoid the failure of sending the mail, for example, if there are a plurality of attachments, the number of attachments can be reduced, and the attachments can be sent for a plurality of times; if there is only one nearby, the file may also be cut into multiple copies using a software tool and then sent in portions, and so on.
Or the attachment size threshold value can be prompted to the user, so that the user can obtain a more intuitive reference when editing the email again, blindness when adding the attachment is avoided, and usability of the email client is further improved.
As described above, in order to determine whether an attachment is oversized before a user clicks a send email and perform a corresponding prompt when the attachment is oversized, a size threshold of the attachment for performing the prompt needs to be known in advance.
Detailed description of the invention
In the first embodiment, the maximum value of the attachment size that can be supported by the delivery server may be used as the attachment size threshold that needs to be presented, and the threshold may be stored. That is, it is necessary to know the maximum value of the attachment size that the delivery server can support, and then to take the maximum value as the attachment size threshold. There may be various implementations of specifically knowing the maximum value of the attachment size that the delivery server can support, which are described below.
In the first mode, because a user uses an email client for the first time and sends an email through an account of the user, the email client needs to perform some information interaction with a sending server according to the SMTP protocol, and therefore, in the first mode, the method can be realized by expanding the SMTP protocol.
For example, when a user sends an email for the first time, information of a sending server corresponding to the account needs to be created, including an IP address and a port of the sending server, and a user name and a password used by the user. After creating the information of the sending server, the e-mail client will actively send an EHLO command to the sending server, and after receiving the EHLO command, the sending server will return some information to the e-mail client, including HELP information returned by the HELP command, etc. According to the feature, the SMTP protocol can be extended, for example, as shown in fig. 3, a "MaxAttSize" command (the name of the command may not be limited thereto) is an extension of the SMTP protocol, and the maximum value of the attachment size that can be supported by the sending server can be sent to the email client through the MaxAttSize command, and the email client records the information and uses the information as the threshold of the attachment size that needs to be prompted. Thus, when a user creates an email by using the account, if the attachment added by the user exceeds the threshold value, the user can be prompted in advance to 'the attachment is too large and cannot be sent', and the like.
In the second mode, since some information also needs to be interacted between the email client and the sending server in the process of sending one email, the sending server can also carry the maximum value of the attachment size which can be supported by the sending server in the interactive information. That is, the maximum attachment size that the sending server can support can be known from the message returned by the sending server in the process of sending the first email.
Obviously, in this way, when sending the first email, if an attachment is also added, it is impossible to give a prompt to the user whether the attachment is oversized, but when sending the first email and then needing to send the email using the account, it is possible to give a relevant prompt to the user by using the acquired attachment size threshold that needs to be prompted.
Detailed description of the invention
In this second embodiment, an estimated value can be used as the attachment size threshold that needs to be prompted, instead of the maximum attachment size that can be supported by the sending server.
For example, the following method can be specifically adopted: when a user sends a mail, if the mail carries an attachment, the electronic mail client can record the size of the attachment; if the sending fails because the attachment is too large, the sending server informs the email client that the sending fails because the attachment is too large. Of course, there is no corresponding command in the existing SMTP protocol, and the implementation may be realized by extending the protocol, for example, an Error Code representing that the sending of the attachment is too large may be defined, and the sending server may notify the e-mail client that a certain mail fails to be sent because the attachment is too large by sending the Error Code, for example, "Error Code (att to large)" as shown in fig. 4 is an extension to the mail protocol. After learning the message, the email client can record the size max1 of the attachment carried by the email, and use the size max1 as the attachment size threshold that needs to be prompted, and when the email is sent later, the attachment cannot exceed the size max 1.
Of course, the size of this max1 may not be the maximum value for the exact sender-server-limited attachment size, and therefore, may be optimized later in the mail delivery process. That is, when the size of the attachment added by the user does not exceed the threshold, if the mail transmission fails and the reason for the failure is that the attachment is too large, the attachment size threshold that needs to be presented is updated to the size of the attachment. For example, if the size of an attachment added to a mail sent again by the user is max2, this max2 is smaller than max1, and therefore, the user is not prompted; however, when the mail is sent, it is found that the size of the attachment still exceeds the server limit, and at this time, the attachment size threshold value to be presented may be updated to max 2. The updating is performed in sequence, and the obtained threshold value is optimized every time the updating is performed, so that the maximum value of the attachment size limited by the attachment server is approached finally.
The method for updating the obtained prompt threshold may be applied to other methods for obtaining the prompt threshold. For example, in the method of the first embodiment, although the maximum value of the attachment sizes that can be supported by the sending server is sent to the mail client, theoretically, the attachment size that can be added by the user can be successfully sent as long as the attachment size does not exceed the maximum value, in practical applications, the attachment size that can be actually added may be slightly lower than the theoretical maximum value. For example, when the size of the attachment added by the user is 19.8M, the mail client does not prompt the user for the information that the attachment is too large according to the method of the first embodiment, where the limitation of the attachment size by a certain sending server is 20M; however, during a particular sending process, the 19.8M attachment may still be too large to send properly. At this time, a method similar to that in the second embodiment may be adopted, that is, when the size of the attachment added by the user does not exceed the pre-acquisition and storage threshold, if the mail transmission fails and the reason for the failure in the mail transmission is that the attachment is too large, the attachment size threshold that needs to be prompted is updated to the size of the attachment. That is, in the above example, the mail client updates the attachment size threshold value that needs to be presented to 19.8M, so that when the user sends a mail later, if the size of the attached file exceeds 19.8M, the user is prompted that the attached file cannot be normally sent.
Corresponding to the method for prompting the information of the email attachment provided by the embodiment of the present invention, the embodiment of the present invention also provides a terminal for prompting the information of the email attachment, and referring to fig. 5, the terminal includes:
a threshold obtaining unit 501, configured to obtain and store, by a sending server, an attachment size threshold that needs to be prompted;
an attachment size learning unit 502, configured to learn the size of an attachment added by a user when the user creates a mail;
a first information prompting unit 503, configured to prompt the user that the email cannot be sent when the size of the attachment added by the user exceeds the threshold before the created email is not sent.
Therefore, if the user adds the attachment in the mail, before the user clicks the sending button, the embodiment of the invention can judge whether the sending is failed probably because the attachment is overlarge, and if so, the user can be prompted that the mail cannot be sent. In this way, since the transmission has not been clicked yet, the user can find the problem in time without waiting until the transmission is clicked.
In order to make the user obtain more information and further improve the usability of the e-mail client, referring to fig. 6, the terminal further includes:
the second information prompting unit 504 is configured to prompt the user that the reason why the mail cannot be sent is that the attachment is too large.
Alternatively, the terminal may further include:
a third information prompting unit 505, configured to prompt the user for the attachment size threshold.
In some embodiments, the threshold obtaining unit 501 may obtain the accessory size threshold that needs to be prompted, where in one embodiment, the maximum value of the accessory size that can be supported by the sending server may be used as the accessory size threshold that needs to be prompted, and accordingly, referring to fig. 7, the threshold obtaining unit 501 may include:
a maximum value learning subunit 5011, configured to learn a maximum value of sizes of attachments that can be supported by the delivery server;
a first threshold determining subunit 5012, configured to determine the maximum value as the accessory size threshold that needs to be prompted.
The maximum value learning subunit 5011 may include:
the first learning subunit is used for receiving a message sent by a sending server after an account is created when a user needs to send an email for the first time, and learning the maximum value of the attachment size which can be supported by the sending server from the message;
or,
and the second learning subunit is used for learning the maximum value of the attachment size which can be supported by the sending server from the message returned by the sending server in the first e-mail sending process.
In another way of acquiring the accessory size threshold that needs to be prompted, an estimated value may be used as the accessory size threshold that needs to be prompted, and in this case, referring to fig. 8, the threshold acquiring unit 501 may include:
an error code receiving subunit 5013 configured to receive an error code returned by the delivery server if the mail delivery fails;
the second threshold determination subunit 5014 is configured to determine, if the reason for the failure of sending the mail is that the attachment is too large, the size of the attachment carried by the mail as the attachment size threshold that needs to be prompted.
In the subsequent process of sending the email, the obtained prompt threshold value may be optimized, and correspondingly, the terminal may further include:
a threshold updating unit 506, configured to update the size threshold of the attachment that needs to be prompted to the size of the attachment if the mail transmission fails and the reason for the failure in the mail transmission is that the attachment is too large when the size of the attachment added by the user does not exceed the threshold.
It will be understood by those skilled in the art that all or part of the steps in the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, where the program may be stored in a computer readable storage medium, and when executed, the program includes the following steps: acquiring and storing an attachment size threshold value needing to be prompted through a sending server; when a user creates a mail, acquiring the size of an attachment added by the user; and before the created mail is not sent, when the size of the attachment added by the user exceeds the threshold value, prompting the user that the mail cannot be sent. The storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
The method and the terminal for prompting the email attachment information provided by the invention are described in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.