зеркало из https://github.com/mozilla/gecko-dev.git
Implement some primitive error handling for sending mail.
This commit is contained in:
Родитель
afd197ca24
Коммит
d433d136be
|
@ -80,9 +80,9 @@ sub output {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my($app, $session, $string) = @_;
|
my($app, $session, $string) = @_;
|
||||||
$self->assert(defined($self->handle), 1, 'No SMTP handle, can\'t send mail');
|
$self->assert(defined($self->handle), 1, 'No SMTP handle, can\'t send mail');
|
||||||
$self->handle->mail($self->from);
|
$self->assert($self->handle->mail($self->from), 1, 'Could not start sending mail');
|
||||||
$self->handle->to($session->getAddress('email'));
|
$self->assert($self->handle->to($session->getAddress('email')), 1, 'Could not set mail recipient (was going to send to '.($session->getAddress('email')).')');
|
||||||
$self->handle->data($string);
|
$self->assert($self->handle->data($string), 1, 'Could not send mail body');
|
||||||
}
|
}
|
||||||
|
|
||||||
# protocol.smtp
|
# protocol.smtp
|
||||||
|
|
Загрузка…
Ссылка в новой задаче