D
daniel wijnands
Hello
I retrieve a number of message 1 to n
And try to send these by stmp that is no problem with te following code
:
messages = Spool.find_created_messages
Net::SMTP.start('sigma.itxl.nl',25,'itxl.nl') do | smtp |
for message in messages
begin
smtp.send_message message.mime_content, message.email_from
,message.email_to
message.destroy
rescue Net::SMTPSyntaxError
message.state = 'ERROR'
message.save
rescue Exception => exc
message.state = 'ERROR'
message.save
STDERR.puts "General spool error #{exc.class} #{exc.message}"
end
end
end
I would like to handel smtp errors gracefully, log the message en
continue with the next message
in the loop.
For example when the email adres has a syntac error danielitxl.nl ( no
@)
The next message should be sended, so the system doesn't get halted
Any ideas ?
Thanks in advantage
I retrieve a number of message 1 to n
And try to send these by stmp that is no problem with te following code
:
messages = Spool.find_created_messages
Net::SMTP.start('sigma.itxl.nl',25,'itxl.nl') do | smtp |
for message in messages
begin
smtp.send_message message.mime_content, message.email_from
,message.email_to
message.destroy
rescue Net::SMTPSyntaxError
message.state = 'ERROR'
message.save
rescue Exception => exc
message.state = 'ERROR'
message.save
STDERR.puts "General spool error #{exc.class} #{exc.message}"
end
end
end
I would like to handel smtp errors gracefully, log the message en
continue with the next message
in the loop.
For example when the email adres has a syntac error danielitxl.nl ( no
@)
The next message should be sended, so the system doesn't get halted
Any ideas ?
Thanks in advantage