Safe Haskell | None |
---|
- sendMail :: HostName -> Mail -> IO ()
- sendMail' :: HostName -> PortNumber -> Mail -> IO ()
- sendMailWithLogin :: HostName -> UserName -> Password -> Mail -> IO ()
- sendMailWithLogin' :: HostName -> PortNumber -> UserName -> Password -> Mail -> IO ()
- simpleMail :: Address -> [Address] -> [Address] -> [Address] -> Text -> [Part] -> Mail
- plainTextPart :: Text -> Part
- htmlPart :: Text -> Part
- filePart :: Text -> FilePath -> IO Part
- module Network.Mail.SMTP.Types
- data SMTPConnection
- sendmail :: ByteString -> IO ()
- sendmailCustom :: FilePath -> [String] -> ByteString -> IO ()
- renderSendMail :: Mail -> IO ()
- renderSendMailCustom :: FilePath -> [String] -> Mail -> IO ()
- connectSMTP :: HostName -> IO SMTPConnection
- connectSMTP' :: HostName -> PortNumber -> IO SMTPConnection
- sendCommand :: SMTPConnection -> Command -> IO (ReplyCode, ByteString)
- login :: SMTPConnection -> UserName -> Password -> IO (ReplyCode, ByteString)
- closeSMTP :: SMTPConnection -> IO ()
- renderAndSend :: SMTPConnection -> Mail -> IO ()
Main interface
sendMail :: HostName -> Mail -> IO ()Source
Connect to an SMTP server, send a Mail
, then disconnect. Uses the default port (25).
sendMail' :: HostName -> PortNumber -> Mail -> IO ()Source
Connect to an SMTP server, send a Mail
, then disconnect.
sendMailWithLogin :: HostName -> UserName -> Password -> Mail -> IO ()Source
Connect to an SMTP server, login, send a Mail
, disconnect. Uses the default port (25).
sendMailWithLogin' :: HostName -> PortNumber -> UserName -> Password -> Mail -> IO ()Source
Connect to an SMTP server, login, send a Mail
, disconnect.
:: Address | from |
-> [Address] | to |
-> [Address] | CC |
-> [Address] | BCC |
-> Text | subject |
-> [Part] | list of parts (list your preferred part last) |
A simple interface for generating a Mail
with a plantext body and
an optional HTML body.
plainTextPart :: Text -> PartSource
Construct a plain text Part
Construct a file attachment Part
Types
module Network.Mail.SMTP.Types
Network.Mail.Mime's sendmail interface (reexports)
sendmail :: ByteString -> IO ()
Send a fully-formed email message via the default sendmail executable with default options.
:: FilePath | sendmail executable path |
-> [String] | sendmail command-line options |
-> ByteString | mail message as lazy bytestring |
-> IO () |
Send a fully-formed email message via the specified sendmail executable with specified options.
renderSendMail :: Mail -> IO ()
Render an email message and send via the default sendmail executable with default options.
:: FilePath | sendmail executable path |
-> [String] | sendmail command-line options |
mail to render and send | |
-> IO () |
Render an email message and send via the specified sendmail executable with specified options.
Establishing Connection
:: HostName | name of the server |
-> IO SMTPConnection |
Connect to an SMTP server with the specified host and default port (25)
:: HostName | name of the server |
-> PortNumber | port number |
-> IO SMTPConnection |
Connect to an SMTP server with the specified host and port
Operation to a Connection
sendCommand :: SMTPConnection -> Command -> IO (ReplyCode, ByteString)Source
Send a Command
to the SMTP server
login :: SMTPConnection -> UserName -> Password -> IO (ReplyCode, ByteString)Source
closeSMTP :: SMTPConnection -> IO ()Source
Send QUIT
and close the connection.
renderAndSend :: SMTPConnection -> Mail -> IO ()Source
Render a Mail
to a ByteString
then send it over the specified
SMTPConnection