Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Unable to send a message Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
sbrady
Newbie
Newbie


Joined: 02 March 2009
Online Status: Offline
Posts: 12
Posted: 11 March 2009 at 7:01am | IP Logged Quote sbrady

We are receiving the following error when using mailbee smtp to send a message:

An unhandled exception of type 'MailBee.MailBeeSocketObjectDisposedException' occurred in MailBee.NET.dll

Additional information: The socket object used by MailBee was unexpectedly closed. InnerException message follows: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

The code causing this error is:

             Smtp.LicenseKey = "XXXXX";
             Smtp mailer = new Smtp();
             mailer.SmtpServers.Add("server.domain.com", @"domain\user name", @"@password");
             mailer.Message.From.AsString = "ifamily@domain.com";
             mailer.Message.To.AsString = "ifamily@domain.com";
             mailer.Message.Subject = "Hi";
             mailer.Message.BodyPlainText = "Hello";
             mailer.Send();

Back to Top View sbrady's Profile Search for other posts by sbrady
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 13 March 2009 at 1:45am | IP Logged Quote Andrew

This exception is thrown when underlying socket operation unexpectedly throws ObjectDisposedException.

There're two typical reasons:

- A firewall/antivirus/antispam software intercept traffic and breaks normal connection flow. We encountered many applications of such kind which have various bugs which causes weird issues.

- The mail server was busy or network connection was under heavy load, so the mail server didn't reply during long time, so the socket was closed by timeout.

If the issue happens occasionally, it most probably is caused by the mail server, but if it happens each time you run the application, you should try to temporarily disable the traffic filter for testing purposes.

Also, logging may shed some light on what exactly goes wrong.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
sbrady
Newbie
Newbie


Joined: 02 March 2009
Online Status: Offline
Posts: 12
Posted: 20 March 2009 at 12:18pm | IP Logged Quote sbrady

I've used this SMTP server with stand asp.net smtp controls to send messages without any problem. I am attaching the logging below. It appears that I was able to login and authenticate correctly, but when it tried to send it failed:

[15:15:10.24] [INFO] Assembly version: 5.0.2.121.
[15:15:10.24] [INFO] Will send mail message.
[15:15:10.30] [INFO] Will resolve host "dedun.atum.net".
[15:15:10.30] [INFO] Host "dedun.atum.net" resolved to IP address(es) 216.94.1.241.
[15:15:10.30] [INFO] Will connect to host "dedun.atum.net" on port 25.
[15:15:10.32] [INFO] Socket connected to IP address 216.94.1.241 on port 25.
[15:15:10.43] [RECV] 220 dedun.atum.net Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Fri, 20 Mar 2009 15:19:09 -0400 \r\n
[15:15:10.43] [INFO] Connected to mail service at host "dedun.atum.net" on port 25 and ready.
[15:15:10.43] [INFO] Will send Hello command (HELO or EHLO).
[15:15:10.44] [SEND] EHLO atum.com\r\n
[15:15:10.49] [RECV] 250-dedun.atum.net Hello [216.191.53.136] \r\n250-TURN\r\n250-SIZE\r\n250-ETRN\r\n250-PIPELINING\r\n25 0-DSN\r\n250-ENHANCEDSTATUSCODES\r\n250-8bitmime\r\n250-BINA RYMIME\r\n250-CHUNKING\r\n250-VRFY\r\n250-TLS\r\n250-STARTTL S\r\n250-X-EXPS LOGIN\r\n250-X-EXPS=LOGIN\r\n250-AUTH LOGIN\r\n250-AUTH=LOGIN\r\n250-X-LINK2STATE\r\n250-XEXCH50\r \n250 OK\r\n
[15:15:10.51] [INFO] SMTP Hello completed.
[15:15:10.52] [INFO] Will login as "scott brady@atum.net".
[15:15:10.52] [INFO] Will try SASL LOGIN authentication method.
[15:15:10.52] [SEND] AUTH LOGIN\r\n
[15:15:10.58] [RECV] 334 VXNlcm5hbWU6\r\n
[15:15:10.58] [SEND] ********\r\n
[15:15:10.63] [RECV] 334 UGFzc3dvcmQ6\r\n
[15:15:10.65] [SEND] ********\r\n
[15:15:10.69] [RECV] 235 2.7.0 Authentication successful.\r\n
[15:15:10.69] [INFO] Logged in as "scott brady@atum.net".
[15:15:10.69] [INFO] Will send mail message to SMTP server "dedun.atum.net".
[15:15:10.71] [INFO] Will submit sender and recipients.
[15:15:10.72] [SEND] MAIL FROM:<sbrady@atum.com>\r\n
[15:15:10.72] [SEND] RCPT TO:<sbrady@atum.com>\r\n
[15:15:10.77] [RECV] 250 2.1.0 sbrady@atum.com....Sender OK\r\n
[15:15:10.83] [RECV] 250 2.1.5 sbrady@atum.com \r\n
[15:15:10.83] [INFO] Sender and recipients accepted by SMTP server. Will send message data now.
[15:15:10.85] [SEND] BDAT 276 LAST\r\n
[15:15:10.85] [SEND] [Data chunk of 276 bytes sent.]
[15:15:31.41] [INFO] Will disconnect from host "dedun.atum.net".
[15:15:31.41] [INFO] Disconnected from host "dedun.atum.net".
[15:15:31.41] [INFO] Error: The socket object used by MailBee was unexpectedly closed. InnerException message follows: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Back to Top View sbrady's Profile Search for other posts by sbrady
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 20 March 2009 at 2:10pm | IP Logged Quote Igor

Try to disable CHUNKING ESMTP extension:

Code:
server.SmtpOptions = ExtendedSmtpOptions.NoChunking


It's assumed server is SmtpServer instance which you'll add to Smtp.SmtpServers collection.

Also, you may try to set Global.SafeMode = true prior to creating any instances of SmtpServer and Smtp classes. This will turn the compatibility mode on (the performance will suffer, however).

Regards,
Igor
Back to Top View Igor's Profile Search for other posts by Igor
 
sbrady
Newbie
Newbie


Joined: 02 March 2009
Online Status: Offline
Posts: 12
Posted: 23 March 2009 at 6:42am | IP Logged Quote sbrady

Thanks, that worked.
Back to Top View sbrady's Profile Search for other posts by sbrady
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide