Implement some primitive error handling for sending mail.

This commit is contained in:
ian%hixie.ch 2001-11-09 21:59:21 +00:00
Родитель afd197ca24
Коммит d433d136be
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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