Safe Haskell | None |
---|
- sendMail :: String -> PortNumber -> Mail -> IO ()
- sendMailWithLogin :: String -> PortNumber -> UserName -> Password -> Mail -> IO ()
- simpleMail :: Address -> [Address] -> Text -> Text -> Maybe Text -> Mail
- data Command
- = HELO ByteString
- | EHLO ByteString
- | MAIL ByteString
- | RCPT ByteString
- | DATA ByteString
- | EXPN ByteString
- | VRFY ByteString
- | HELP ByteString
- | AUTH AuthType UserName Password
- | NOOP
- | RSET
- | QUIT
- data Response
- = Ok
- | SystemStatus
- | HelpMessage
- | ServiceReady
- | ServiceClosing
- | UserNotLocal
- | CannotVerify
- | StartMailInput
- | ServiceNotAvailable
- | MailboxUnavailable
- | ErrorInProcessing
- | InsufficientSystemStorage
- | SyntaxError
- | ParameterError
- | CommandNotImplemented
- | BadSequence
- | ParameterNotImplemented
- | MailboxUnavailableError
- | UserNotLocalError
- | ExceededStorage
- | MailboxNotAllowed
- | TransactionFailed
- type ReplyCode = Int
- data SMTPConnection
- type UserName = String
- type Password = String
- data AuthType
- data Address = Address {
- addressName :: Maybe Text
- addressEmail :: Text
- sendmail :: ByteString -> IO ()
- sendmailCustom :: FilePath -> [String] -> ByteString -> IO ()
- renderSendMail :: Mail -> IO ()
- renderSendMailCustom :: FilePath -> [String] -> Mail -> IO ()
- connectSMTPPort :: String -> PortNumber -> IO SMTPConnection
- connectSMTP :: String -> IO SMTPConnection
- sendCommand :: SMTPConnection -> Command -> IO (ReplyCode, ByteString)
- closeSMTP :: SMTPConnection -> IO ()
- renderAndSend :: SMTPConnection -> Mail -> IO ()
Main interface
sendMail :: String -> PortNumber -> Mail -> IO ()Source
Connect to an SMTP server, send a Mail
, then disconnect.
sendMailWithLogin :: String -> PortNumber -> UserName -> Password -> Mail -> IO ()Source
Connect to an SMTP server, login, send a Mail
, disconnect.
:: Address | from |
-> [Address] | to |
-> Text | subject |
-> Text | plain body |
-> Maybe Text | optional HTML body |
A simple interface for generating a Mail
with a plantext body and
an optional HTML body.
Types
data SMTPConnection Source
Auth Types (reexports)
Network.Mail.Mime types (reexports)
data Address
Address | |
|
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
:: String | name of the server |
-> PortNumber | port number |
-> IO SMTPConnection |
Connect to an SMTP server with the specified host and port
:: String | name of the server |
-> IO SMTPConnection |
Connect to an SMTP server with the specified host and default port (25)
Operation to a Connection
sendCommand :: SMTPConnection -> Command -> IO (ReplyCode, ByteString)Source
Send a Command
to the SMTP server
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