Pike v8.1 release 6

Method Protocols.SMTP.Client()->create()


Method create

Protocols.SMTP.Client Protocols.SMTP.Client()
Protocols.SMTP.Client Protocols.SMTP.Client(Stdio.File server)
Protocols.SMTP.Client Protocols.SMTP.Client(string server, void|int port)

Description

Creates an SMTP mail client and connects it to the the server provided. The server parameter may either be a string with the hostname of the mail server, or it may be a file object acting as a mail server. If server is a string, then an optional port parameter may be provided. If no port parameter is provided, port 25 is assumed. If no parameters at all is provided the client will look up the mail host by searching for the DNS MX record.

Throws

Throws an exception if the client fails to connect to the mail server.