Author |
|
jleely Newbie
Joined: 25 October 2016 Location: United States
Online Status: Offline Posts: 4
|
Posted: 25 October 2016 at 3:07pm | IP Logged
|
|
|
Hi, we're using MailBee.NET.45 and SmtpClient to send mail and we are getting an error "A call to SSPI failed. see inner exception" and the exception is not very helpful.
Has anyone experienced something similar? and how do you fix this?
Thanks in advance.
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 26 October 2016 at 12:14am | IP Logged
|
|
|
Can you please provide full exception message? Also, please post the section of your code where SSL-enabled access to SMTP server is configured (assuming that exists in your code of course).
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
jleely Newbie
Joined: 25 October 2016 Location: United States
Online Status: Offline Posts: 4
|
Posted: 26 October 2016 at 9:57am | IP Logged
|
|
|
This is the full exception message.
System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The message received was unexpected or badly formatted
This is the code to initialize the SmtpServer object.
SmtpServer server = new SmtpServer();
server.Name = "smtp.test.com";
server.Port = 587 //or whatever port the user enters
server.SslMode = SslStartupMode.Manual
server.Password = "testPW";
server.AuthMethods = AuthenticationMethods.Auto
server.SslProtocol = //we set this to SecurityProtocol.Tls12 or SecurityProtocol.Tls11 or SecurityProtocol.Auto
To send we simply do:
SmtpClient client = new Smtp();
client.SmtpServers.Add(server);
client.Message = message;
client.Send();
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 26 October 2016 at 10:00am | IP Logged
|
|
|
Thanks. 587 is not SSL port, 465 is. Or, you'll need to use SslStartupMode.UseStartTls (in case if the server can switch to SSL connection on a regular port).
Regards,
Alex
|
Back to Top |
|
|
jleely Newbie
Joined: 25 October 2016 Location: United States
Online Status: Offline Posts: 4
|
Posted: 26 October 2016 at 10:30am | IP Logged
|
|
|
Hmm.. According to this http://www.afterlogic.com/mailbee-net/docs/smtp_over_ssl.html#Autodetect
I was under the impressions that if the mode is set to SslStartupMode.Manual, and port is 587, Mailbee.NET will use UseStartTlsIfSupported.
"If you explicitly specified the port 587 but haven't changed the SSL mode from the default value SslStartupMode.Manual, MailBee.NET will use SslStartupMode.UseStartTlsIfSupported."
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 27 October 2016 at 1:46am | IP Logged
|
|
|
For me, it works normally. Maybe you're using an older build. You can get the latest from http://www.afterlogic.com/updates/mailbee_net.zip
Regards,
Alex
|
Back to Top |
|
|
jleely Newbie
Joined: 25 October 2016 Location: United States
Online Status: Offline Posts: 4
|
Posted: 27 October 2016 at 9:28am | IP Logged
|
|
|
I don't think so. I am on Version 10.0.502
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 27 October 2016 at 9:39am | IP Logged
|
|
|
Zip file contains newer build.
Regards,
Alex
|
Back to Top |
|
|