Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: MailBeeSslWin32Exception Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
JerseyMike
Newbie
Newbie


Joined: 02 August 2006
Location: United States
Online Status: Offline
Posts: 13
Posted: 12 September 2006 at 2:06pm | IP Logged Quote JerseyMike

I am testing the .NET SMTP component out against a couple of different servers. Some of the servers require SSL...others do not. I am able to connect, authenticate, and send email against the servers that do not require SSL.

However, when I attempt to send a message to a server using SSL...I receive the MailBeeSslWin32Exception.

Here is how I am setting the SSL mode of the SMTP server:

server = New SmtpServer(txtSMTPServer.Text, txtSMTPUsername.Text, txtSMTPPassword.Text)
             If chkUseSSL.Checked Then
                server.SslMode = Security.SslStartupMode.OnConnect
             End If
             mailer.SmtpServers.Add(server)

What am I missing? I've tried this against a couple of servers like gmail, our exchange server, etc.

Thanks,
Mike
Back to Top View JerseyMike's Profile Search for other posts by JerseyMike
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 12 September 2006 at 2:23pm | IP Logged Quote Alex

Accordingly MailBeeSslWin32Exception Class description, you made an attempt to connect to a wrong port. You should either connect to SSL port (such as 465 for S/SMTP) or tell MailBee to connect to a regular port and then switch to SSL mode using STARTTLS command.
Code:

' Connect to SSL port
If chkUseSSL.Checked Then
  server.Port = 465
End If

or
Code:

' SSL over regular port (STARTTLS)
If chkUseSSL.Checked Then
  server.SslMode = Security.SslStartupMode.UseStartTls
End If


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


Joined: 02 August 2006
Location: United States
Online Status: Offline
Posts: 13
Posted: 12 September 2006 at 2:33pm | IP Logged Quote JerseyMike

Alex,

I am setting the port to 465 in my code (not the snippet I provided). Previously, I was using the UseStartTls mode but was getting messages that the protocol was not supported. So...I went with the approach that I outlined above.

Any other ideas why this would be failing?

Thanks,
Mike
Back to Top View JerseyMike's Profile Search for other posts by JerseyMike
 
JerseyMike
Newbie
Newbie


Joined: 02 August 2006
Location: United States
Online Status: Offline
Posts: 13
Posted: 12 September 2006 at 2:40pm | IP Logged Quote JerseyMike

Alex,

My bad, the port was not getting set correctly after I set the SSL mode. Once I did this, it worked fine.

Thanks for the quick response.

Mike
Back to Top View JerseyMike's Profile Search for other posts by JerseyMike
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 12 September 2006 at 2:44pm | IP Logged Quote Alex

Could you please set UseStartTls mode back, revert to default port (25), enable logging SMTP session into a file, then reproduce the problem by making an attempt to connect to smtp.gmail.com, and then send us the log to support@afterlogic.com? You can enable logging as follows:
Code:

smtp.Log.Enabled = True
smtp.Log.Filename = "C:\log.txt"

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 12 September 2006 at 2:47pm | IP Logged Quote Alex

That's great news. You're quick :-).

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

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