+1 vote

Hi,
I'm having trouble sending the email via the SendMessage function.
I get an error back "cannot access object"

StackTrace:
in Limilabs.Client.ClientBase. ()
in Limilabs.Client.ClientBase. ()
in Limilabs.Client.ClientBase. (Byte[] )
in Limilabs.Client.ClientBase. (String )
in Limilabs.Client.SMTP.Smtp.SendCommand(String command, Boolean throwException)
in Limilabs.Client.SMTP.Smtp. (String , Boolean )
in Limilabs.Client.SMTP.Smtp. (SmtpMail )
in Limilabs.Client.SMTP.Smtp.SendMessage(SmtpMail smtpMail)
in Limilabs.Client.SMTP.Smtp.SendMessage(IMail email)
in Syslab.Dati.MailBase.InviaSMTP(Smtp SMTP, ArrayList PercorsoAllegati)

code:
Dim SMTP As Limilabs.Client.SMTP.Smtp

SMTP = ... more code ...

Dim builder As New Limilabs.Mail.MailBuilder()
... more code ...

Dim eMailSMTP As Limilabs.Mail.IMail = builder.Create()
... more code ...
Dim Result As Limilabs.Client.SMTP.ISendMessageResult
If Not SMTP Is Nothing Then
Try
Result = SMTP.SendMessage(eMailSMTP)
Console.WriteLine(Result.Status)
Catch ex As Exception
End Try
SMTP.Close()
End If

by
Are you using the latest version (https://www.limilabs.com/static/mail/ReleaseNotes.txt).

What is the exception type?

Does it happen always? For every message?

Can you turn on logging:
https://www.limilabs.com/blog/logging-in-mail-dll

1 Answer

+1 vote
 
Best answer

Exception is: System.ObjectDisposedException
{"Impossibile accedere a un oggetto eliminato. Nome oggetto: 'ClientBase'."}

in the log there is only written:
Eccezione first-chance di tipo 'System.ObjectDisposedException' in Mail.dll

--------------RESOLVED--------------
the error appeared because the connection had been closed. Thanks for the support, I hope this ticket can help someone!

by (450 points)
selected by
...