NAME

Mojo::SMTP::Client::Response - Response class for Mojo::SMTP::Client

SYNOPSIS

use Mojo::SMTP::Client;

my $smtp = Mojo::SMTP::Client->new;
my $resp = $smtp->send(from => $from, to => $to, data => $msg);
if ($resp->error) {
	die $resp->error;
}

say "Sent successfully with last response = ", $resp;

DESCRIPTION

Mojo::SMTP::Client::Response represents response from SMTP server and may be used to get code, message or raw response.

ATTRIBUTES

Mojo::SMTP::Client::Response implements the following attributes

error

Error for this response. Should be one of Mojo::SMTP::Client::Exception::* defined in Mojo::SMTP::Client::Exception or error throwed by the user from an event handler. Default is undef.

METHODS

Mojo::SMTP::Client::Response implements the following methods

new($raw_resp, ...)

Contructs new Mojo::SMTP::Client::Response object. One required parameter is raw response from SMTP server as a string.

code

Get three-digit code for this response. May be undefined if response was not received because of error in the stream (timeout or other).

message

Get message for this response. Will contain several lines for multiline responses. May be undefined if response was not received because of error in the stream (timeout or other).

to_string

Get raw response as a string. Response will be also auto stringified in string context.

SEE ALSO

Mojo::SMTP::Client, Mojo::SMTP::Client::Response, Mojo::SMTP::Client::Exception

COPYRIGHT

Copyright Oleg G <oleg@cpan.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.