Last active
December 14, 2015 15:49
-
-
Save cheald/5110319 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Used to talk to your "relay server" or smart host. | |
# It supports a few simple operations for sending mail, replying, and can | |
# log the protocol it uses to stderr if you set debug=1 on __init__. | |
class Relay | |
# Public: Set up a new relay | |
# host - the host to connect to. May accept an IP address or hostname | |
# port - the port to connect to | |
# username - optional username to authorize with | |
# password - optional password to authorize with | |
# ssl - Flag to toggle SSL usage | |
# starttls - Use TLS. If set, the `ssl` flag is ignored. | |
# debug - Debug level to use | |
def initialize(host = '127.0.0.1', port = 25, username = nil, password = nil, ssl = False, starttls = False, debug = 0) | |
@hostname = host | |
@port = port | |
@debug = debug | |
@username = username | |
@password = password | |
@ssl = ssl | |
@starttls = starttls | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment