Sending email with Javamail via imap

The convention using JavaMail is as follows: - Use smtp to send emails - Use imap (or pop) to read emails.

In our applications, I find it more useful to use a mail client protocol (specifically for imap) to send emails .. and ensure that copies of all emails sent are sent to the Sent folder of gmail or whatever email account you use.

Note that the main point of email connection is simply sending emails, not reading or polling emails.

Would love the opinions / suggestions / examples from others who have used imap to send emails from their java applications. All messages are appreciated.

+3


source to share


1 answer


Simple answer: sending emails with IMAP is not possible. You must use SMTP to send emails.

More precisely, there are some extensions to combine send and seek operations. However, as far as I know, these extensions are not widely distributed - neither client-side nor server-side.



See also wikipedia article on IMAP ( IMAP # Disadvantages ):

Unlike some proprietary protocols that combine send and receive operations, sending a message and saving a copy to a server folder with a basic IMAP client requires sending the message content twice, once for SMTP for delivery, and once for IMAP to store it in the Sent folder. mail. This is fixed by a bunch of extensions ...

+7


source







All Articles