HaskellNet-0.2.1: network related libraries such as POP3, SMTP, IMAPSource codeContentsIndex
HaskellNet.SMTP
Portabilityportable
Stabilitystable
Maintainermukai@jmuk.org
Contents
Types
Establishing Connection
Operation to a Connection
Other Useful Operations
Description
SMTP client implementation
Synopsis
data Command
= HELO String
| EHLO String
| MAIL String
| RCPT String
| DATA ByteString
| EXPN String
| VRFY String
| HELP String
| 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
data BSStream s => SMTPConnection s
connectSMTPPort :: String -> PortNumber -> IO (SMTPConnection Handle)
connectSMTP :: String -> IO (SMTPConnection Handle)
connectStream :: BSStream s => s -> IO (SMTPConnection s)
sendCommand :: BSStream s => SMTPConnection s -> Command -> IO (ReplyCode, ByteString)
closeSMTP :: BSStream s => SMTPConnection s -> IO ()
sendMail :: BSStream s => String -> [String] -> ByteString -> SMTPConnection s -> IO ()
doSMTPPort :: String -> PortNumber -> (SMTPConnection Handle -> IO a) -> IO a
doSMTP :: String -> (SMTPConnection Handle -> IO a) -> IO a
doSMTPStream :: BSStream s => s -> (SMTPConnection s -> IO a) -> IO a
Types
data Command Source
Constructors
HELO String
EHLO String
MAIL String
RCPT String
DATA ByteString
EXPN String
VRFY String
HELP String
AUTH AuthType UserName Password
NOOP
RSET
QUIT
show/hide Instances
data Response Source
Constructors
Ok
SystemStatus
HelpMessage
ServiceReady
ServiceClosing
UserNotLocal
CannotVerify
StartMailInput
ServiceNotAvailable
MailboxUnavailable
ErrorInProcessing
InsufficientSystemStorage
SyntaxError
ParameterError
CommandNotImplemented
BadSequence
ParameterNotImplemented
MailboxUnavailableError
UserNotLocalError
ExceededStorage
MailboxNotAllowed
TransactionFailed
show/hide Instances
data BSStream s => SMTPConnection s Source
Establishing Connection
connectSMTPPortSource
:: Stringname of the server
-> PortNumberport number
-> IO (SMTPConnection Handle)
connecting SMTP server with the specified name and port number.
connectSMTPSource
:: Stringname of the server
-> IO (SMTPConnection Handle)
connecting SMTP server with the specified name and port 25.
connectStream :: BSStream s => s -> IO (SMTPConnection s)Source
create SMTPConnection from already connected Stream
Operation to a Connection
sendCommand :: BSStream s => SMTPConnection s -> Command -> IO (ReplyCode, ByteString)Source
send a method to a server
closeSMTP :: BSStream s => SMTPConnection s -> IO ()Source
close the connection. This function send the QUIT method, so you do not have to QUIT method explicitly.
Other Useful Operations
sendMailSource
:: BSStream s
=> Stringreceivers
-> [String]data
-> ByteString
-> SMTPConnection s
-> IO ()
sending a mail to a server. This is achieved by sendMessage. If something is wrong, it raises an IOexception.
doSMTPPort :: String -> PortNumber -> (SMTPConnection Handle -> IO a) -> IO aSource
doSMTPPort open a connection, and do an IO action with the connection, and then close it.
doSMTP :: String -> (SMTPConnection Handle -> IO a) -> IO aSource
doSMTP is similar to doSMTPPort, except that it does not require port number but connects to the server with port 25.
doSMTPStream :: BSStream s => s -> (SMTPConnection s -> IO a) -> IO aSource
doSMTPStream is similar to doSMTPPort, except that its argument is a Stream data instead of hostname and port number.
Produced by Haddock version 2.6.0