smtp-mail
smtp-mail copied to clipboard
Prelude.read: no parse exception when trying to send an email
Hey,
I have been trying to send an email with the following code:
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified MyLib (someFunc)
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
import Network.Mail.SMTP
from = Address Nothing "[email protected]"
to = [Address (Just "Jason Hickner") "[email protected]"]
cc = []
bcc = []
subject = "email subject"
body = plainTextPart "email body"
html = htmlPart "<h1>HTML</h1>"
mail = simpleMail from to cc bcc subject [body, html]
main :: IO ()
main = do
sendMailWithLogin' "smtp.gmail.com" 465 "username" "pwd" mail
However, I am getting
tesths: Prelude.read: no parse
Any pointers to why this must be happening?
Thanks
The cabal.sbt is just simply:
cabal-version: 2.4
name: tesths
version: 0.1.0.0
-- A short (one-line) description of the package.
-- synopsis:
-- A longer description of the package.
-- description:
-- A URL where users can report bugs.
-- bug-reports:
-- The license under which the package is released.
-- license:
-- The package author(s).
-- author:
-- An email address to which users can send suggestions, bug reports, and patches.
-- maintainer:
-- A copyright notice.
-- copyright:
-- category:
extra-source-files: CHANGELOG.md
library
exposed-modules: MyLib
-- Modules included in this library but not exported.
-- other-modules:
-- LANGUAGE extensions used by modules in this package.
-- other-extensions:
build-depends: base ^>=4.16.1.0, text, mime-mail, smtp-mail
hs-source-dirs: src
default-language: Haskell2010
executable tesths
main-is: Main.hs
-- Modules included in this executable, other than Main.
-- other-modules:
-- LANGUAGE extensions used by modules in this package.
-- other-extensions:
build-depends:
base ^>=4.16.1.0,
tesths,
text,
mime-mail,
smtp-mail
hs-source-dirs: app
default-language: Haskell2010
@kibebr Try sendMailWithLoginTLS
, which has a default port. It could work