$smtp->quit
smtp
This method sends the QUIT command to the remote SMTP server and closes the socket connection.