The Mail class works with SMTP and Google App Engine. AFAIK you cannot send emails with IMAP, you can actually append messages to IMAP 'outbox' or 'sent' folder and wait for the IMAP server synchronization, it is not trivial to send messages with it, most IMAP mail servers offer an SMTP to send emails.
---- IMAP is a protocol for checking email that resides on a server. It is different from and more robust than the "POP<http://luxsci.com/extranet/info/email-pop.html>" protocol that is also for checking email but which is typically used just for downloading messages from people’s INBOXes to their local computers. With IMAP, you can have any number of folders and the email stays on the server for easy access from anywhere and so backups are taken care of for you. That is a simplistic description, but the main point is that both POP and IMAP are for checking email only — there is no functionality in their specifications <http://www.faqs.org/rfcs/rfc3501.html> for sending email. So, while some cases of people saying that they are sending their email outbound via IMAP can be chalked up to them just not knowing the difference between IMAP and SMTP <http://luxsci.com/extranet/info/email-smtp.html>, the other half of their email service that actually does the outbound email sending, some people really do send outbound email via IMAP. How is this done? Some email servers reserve a special IMAP email folder for outbound email messages … often called the "Outbox" or something similar. When a user wants to send an email message "via IMAP" s/he composes it and saves it in this special folder (using IMAP). Then, a special process on the email server looks for and notices a new message in that folder, sends it for the user, and deletes it from the folder. Thus, as far as the user is concerned, s/he sent it via IMAP. ---- [http://luxsci.com/blog/sending-outbound-email-via-imap.html] Take a look at the IMAP Lib specs http://www.doughellmann.com/PyMOTW/imaplib/ You use SmarterMail server, and maybe this server offers you an SMTP address to send emails. [ http://help.smartertools.com/SmarterMail/v4/Default.aspx?qq=%2fsmartermail%2fv4%2fTopics%2fSystemAdmin%2fConfig%2fProtocolSettings.aspx ] On Thu, Mar 8, 2012 at 1:55 AM, Aris Green <[email protected]> wrote: > I am using mail.send and I get messages like the follow: > WARNING:web2py:Mail.send failure:(-1, 'IMAP4rev1 SmarterMail'). Can I use > web2py tools.mail to send messages or do I need another Python library to > send the mail. The settins are similar to this: > > mail.settings.server = 'mail.foo.com:143' > mail.settings.sender = '[email protected]' > mail.settings.login = '[email protected]:FooPassword' > > What magic settings do I need? > > Thanks > greenaj > > -- Bruno Rocha [http://rochacbruno.com.br]

