Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Winsock error when code not in break mode Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Jangla
Newbie
Newbie


Joined: 18 June 2007
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 10 September 2009 at 3:05am | IP Logged Quote Jangla

I've got a little email app that has this function to send a mail:

        Dim smtp = New Smtp

        smtp.LicenseKey = "XXXXX-XXXXXXXXXXXXXXXXXXXXX-XXXX"
        Dim mailer = New Smtp()

        mailer.SmtpServers.Clear()

        mailer.SmtpServers.Add("our.mail.serveraddress", "userName", "password", AuthenticationMethods.SaslLogin Or AuthenticationMethods.SaslPlain)

       
        mailer.Connect()

        mailer.From.Email = emailFromAddress
        mailer.From.DisplayName = emailFirstName & " " & emailSurname
        mailer.To.AsString = emailFirstName & " " & emailSurname & " <" & emailToAddress & ">"
        mailer.Subject = emailSubject

        mailer.BodyPlainText = emailBody

        Try
      
             mailer.Send()

        Catch ex As MailBeeException
             MessageBox.Show(ex.Message, "Error")
             Return False
        Finally
        End Try
        Return True
    End Function

The trouble is that when the application is running without any break points in it, the server chucks a winsock error. When I set a break point on the send command and hold the code there for about 10 seconds, the email sends perfectly.

This is the winsock error:

Thu 2009-09-10 10:00:06: ----------
Thu 2009-09-10 10:00:28: Session 8325; child 1; thread 3796
Thu 2009-09-10 10:00:28: Accepting SMTP connection from [XXX.XX.X.XXX:XXXXX]
Thu 2009-09-10 10:00:28: --> 220 mail.accommodia.com. ESMTP MDaemon 10.1.1; Thu, 10 Sep 2009 10:00:28 +0100
Thu 2009-09-10 10:00:28: <-- EHLO ourdomain.co.uk
Thu 2009-09-10 10:00:28: --> 250-mail.ourdomain.com. Hello ourdomain.co.uk, pleased to meet you
Thu 2009-09-10 10:00:28: --> 250-ETRN
Thu 2009-09-10 10:00:28: --> 250-AUTH=LOGIN
Thu 2009-09-10 10:00:28: --> 250-AUTH LOGIN CRAM-MD5
Thu 2009-09-10 10:00:28: --> 250-8BITMIME
Thu 2009-09-10 10:00:28: --> 250 SIZE
Thu 2009-09-10 10:00:28: <-- AUTH LOGIN
Thu 2009-09-10 10:00:28: --> 334 VXNlcm5hbWU6
Thu 2009-09-10 10:00:28: <-- SmFtZXM=
Thu 2009-09-10 10:00:28: --> 334 UGFzc3dvcmQ6
Thu 2009-09-10 10:00:28: <-- ******
Thu 2009-09-10 10:00:28: --> 235 Authentication successful
Thu 2009-09-10 10:00:28: Authenticated as myemail@address.com
Thu 2009-09-10 10:00:28: <-- MAIL FROM:<sender@ourdomain.co.uk>
Thu 2009-09-10 10:00:28: --> 250 <sender@ourdomain.co.uk>, Sender ok
Thu 2009-09-10 10:00:28: <-- RCPT TO:<recipient@email.com>
Thu 2009-09-10 10:00:28: --> 250 <recipient@email.com>, Recipient ok
Thu 2009-09-10 10:00:28: <-- DATA
Thu 2009-09-10 10:00:28: Creating temp file (SMTP): c:\mdaemon\temp\md50000019421.tmp
Thu 2009-09-10 10:00:28: --> 354 Enter mail, end with <CRLF>.<CRLF>
Thu 2009-09-10 10:00:28: Message size: 594 bytes
Thu 2009-09-10 10:00:28: Passing message through AntiVirus (Size: 594)...
Thu 2009-09-10 10:00:28: * Message is clean (no viruses found)
Thu 2009-09-10 10:00:28: ---- End AntiVirus results
Thu 2009-09-10 10:00:28: Socket error sending response to DATA
Thu 2009-09-10 10:00:28: * Winsock Error 10054 Connection was reset by the other side!
Thu 2009-09-10 10:00:28: SMTP session terminated (Bytes in/out: 747/432)
Thu 2009-09-10 10:00:28: ----------
Thu 2009-09-10 10:00:29: Session 8326; child 1; thread 3796
Thu 2009-09-10 10:00:29: Accepting SMTP connection from [115.75.55.131:19764]
Thu 2009-09-10 10:00:29: * Winsock Error 10054 Connection was reset by the other side!
Thu 2009-09-10 10:00:29: SMTP session terminated (Bytes in/out: 0/0)
Thu 2009-09-10 10:00:29: ----------


Any ideas? (naturally I've chnaged data above to hide passwords, users names, domains etc.)
Back to Top View Jangla's Profile Search for other posts by Jangla
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 10 September 2009 at 3:27am | IP Logged Quote Alex

Does the problem occur only with this mail server?

Doesn't the problem occur if you send the same e-mail through the same server using the same settings with another mail client (e.g. Thunderbird) running on the same computer where MailBee.NET is running?

Are you sure no mail filter like a firewall, traffic meter, anti-spam gateway and so on isn't intercepting the connection? Often, mail filters may cause problems during SMTP conversation.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Jangla
Newbie
Newbie


Joined: 18 June 2007
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 10 September 2009 at 5:39am | IP Logged Quote Jangla

Not sure about whether it's only with this server.

I can send an email from one email account to another through the server using outlook.

Definitely no wirewall stuff. The odd thing is I have another app that works in a similar way, uses almost identical code and that works fine.

Very odd. Will keep plugging at it.
Back to Top View Jangla's Profile Search for other posts by Jangla
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 10 September 2009 at 5:59am | IP Logged Quote Igor

If you'd like AfterLogic Support Team to help you on this, please provide us with a test account we could use to reproduce and investigate the issue.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
Jangla
Newbie
Newbie


Joined: 18 June 2007
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 10 September 2009 at 6:07am | IP Logged Quote Jangla

Jangla wrote:
wirewall stuff.


Translation = Firewall stuff
Back to Top View Jangla's Profile Search for other posts by Jangla
 
Jangla
Newbie
Newbie


Joined: 18 June 2007
Location: United Kingdom
Online Status: Offline
Posts: 9
Posted: 10 September 2009 at 6:09am | IP Logged Quote Jangla

Igor wrote:
If you'd like AfterLogic Support Team to help you on this, please provide us with a test account we could use to reproduce and investigate the issue.

--
Regards,
Igor, AfterLogic Support

Thanks. For the moment I'm going to try and crack it myself.

I have noticed something though. If I use:

if (mailer.Send())
...

I get far more successful sends than if I simply say:

mailer.Send()

...even if there's nothing actually in the If block.
Back to Top View Jangla's Profile Search for other posts by Jangla
 

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