For details of SMTP itself, see RFC2821. You must open a connection to an SMTP server before sending messages. The first argument is the address of your SMTP server, and the second argument is the ...