Email.dcl 1.33 KB
Newer Older
1
definition module iTasks.Extensions.Email
2 3 4
/**
* This module provides basic SMTP email support
*/
5
from Text.HTML import :: HtmlTag
6
from TCPIP     import :: Timeout
7 8 9 10 11 12 13
import iTasks

/**
* Send an e-mail message.
*
* @param Options: Mail server options, when left blank port 25 on localhost is used SMTP server
* @param Sender: The sender address
14
* @param Recipients: The recipient addresses
15 16 17
* @param Subject: The subject line of the e-mail message
* @param Body: The body of the e-mail message
*/
18 19 20 21 22 23 24 25 26
sendEmail :: ![EmailOpt] !String ![String] !String !String -> Task ()

/**
* Send an e-mail message with HTML body.
*
* @param Options: Mail server options, when left blank port 25 on localhost is used SMTP server
* @param Sender: The sender address
* @param Recipients: The recipient addresses
* @param Subject: The subject line of the e-mail message
27
* @param Body: The HTML body of the e-mail message. Text has to be UTF-8 encoded.
28 29
*/
sendHtmlEmail :: ![EmailOpt] !String ![String] !String !HtmlTag -> Task ()
30 31 32

//Options for sendEmail
:: EmailOpt
33 34 35
	= EmailOptSMTPServer !String              //SMTP server to use. Default: localhost
	| EmailOptSMTPServerPort !Int             //TCP port of the SMTP server to use. Default: 25
	| EmailOptExtraHeaders ![(String,String)] //Additional headers to add before the body
36
	| EmailOptTimeout !Timeout                // TCP timeout