Author |
|
JerseyMike Newbie
Joined: 02 August 2006 Location: United States
Online Status: Offline Posts: 13
|
Posted: 12 September 2006 at 2:06pm | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 12 September 2006 at 2:23pm | IP Logged
|
|
|
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 |
|
|
JerseyMike Newbie
Joined: 02 August 2006 Location: United States
Online Status: Offline Posts: 13
|
Posted: 12 September 2006 at 2:33pm | IP Logged
|
|
|
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 |
|
|
JerseyMike Newbie
Joined: 02 August 2006 Location: United States
Online Status: Offline Posts: 13
|
Posted: 12 September 2006 at 2:40pm | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 12 September 2006 at 2:44pm | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 12 September 2006 at 2:47pm | IP Logged
|
|
|
That's great news. You're quick :-).
Regards,
Alex
|
Back to Top |
|
|