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
IOExceptioncustom exceptions were send usingfailure(UserExceptionconstructor). Now there isSMTPExceptionfamily, so if you used to capture SMTP exceptions by processingIOExceptionsyou should captureSMTPExceptionnow. The package may still exposeIOExceptionin case of a network failure. Subjecttype is now using Text. Enabling-XOverladedStringsextension 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 newgracefullyCloseSMTPfunction to run graceful close, you may consider switching to that function fromcloseSTMP. However it should be done with care asgracefullyCloseSTMPcan be run only on the connection that is in a awaiting command from the user state.