Help language development. Donate to The Perl Foundation

Net::SMTP zef:raku-community-modules last updated on 2023-02-01


Actions Status


A pure Raku implementation of a SMTP client.

This module includes two different modes of operation: raw mode (sending raw SMTP commands), and a simple mode (just send this email!).

Example Usage

# raw interface
my $client =""), :port(587), :debug, :raw);
$client.get-response; # 220 ...
$client.ehlo; # 250-STARTTLS\r\n250 ...
$client.mail-from('[email protected]'); # 250 OK
$client.rcpt-to('[email protected]'); # 250 OK
$; # 354 Enter message
$client.payload($email); # 250 OK
$client.quit; # 221 closing connection

#simple interface
my $client =""), :port(587), :debug);
$client.auth($username, $password);
$client.send($from, @to, $message);
$client.send($message); # find From/To/CC/(BCC)? lines

Simple mode methods

Note that all of these methods should return a true value on success or a Failure object if something goes wrong.

Raw mode methods


Andrew Egeler

Source can be located at: . Comments and Pull Requests are welcome.


Copyright 2014 - 2021 Andrew Egeler

Copyright 2022 Raku Community

All files in this repository are licensed under the terms of Create Commons License; for details please see the LICENSE file