This document explains how to update package between major versions of the package.
- Sender, Recipient types were changed from 'Data.Text.Text' to
Network.Mail.Mime.Address.
This change allows better interoperability with 'mime-mail' package, in addition
it solved a problem with specifying sender address in the API.
As Address type implements 'IsString' type class then just having '-XOverloadedStrings'
extension will be enough. However you should note, that "FirstName LastName "
will be parsed as
Address Nothing "FirstName LastName <email>"
and not asAddress (Just "FirstName LastName") "email"
, it may be surprising but that functionality didn't work with older HaskellNet, so it was not changed. - Exception. Previously the package exposed only
IOException
custom exceptions were send usingfailure
(UserException
constructor). Now there isSMTPException
family, so if you used to capture SMTP exceptions by processingIOExceptions
you should captureSMTPException
now. The package may still exposeIOException
in case of a network failure. Subject
type is now using Text. Enabling-XOverladedStrings
extension should help in this case.- All mail sending functions were deprecated instead of them there is the 'sendMail' function. Documentation and deprecation warning for each function explains how to change the code to make it work.
- Now all
doSmtp*
functions implements graceful close, and there is a newgracefullyCloseSMTP
function to run graceful close, you may consider switching to that function fromcloseSTMP
. However it should be done with care asgracefullyCloseSTMP
can be run only on the connection that is in a awaiting command from the user state.