I use lib Network.Mail.Mime to send emails from my Haskell program. I reckon it uses postfix to send the emails. When I try to send mails to my gmail address I do receive them, only they are in the junk, and this happens whatever I fill the "form" fill with. How can I avoid this behavior? Thx
The mime-mail interface will send email, via sendmail, using the simple api:
{-# LANGUAGE OverloadedStrings #-}
import Data.Text
import Network.Mail.Mime
main = do
simpleMail
"[email protected]"
"[email protected]"
"Test"
"This is a test"
""
[]
assuming you're correctly using Data.Text to avoid locale encoding issues.
Now, this is likely to set insufficient headers, so the spam filter will hit it. You may need to ask gmail to not classify this as spam, or alternatively you could set more headers so it doesn't look like fake email.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With