Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: A call to SSPI failed error Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jleely
Newbie
Newbie


Joined: 25 October 2016
Location: United States
Online Status: Offline
Posts: 4
Posted: 25 October 2016 at 3:07pm | IP Logged Quote jleely

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 View jleely's Profile Search for other posts by jleely
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 26 October 2016 at 12:14am | IP Logged Quote Igor

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 View Igor's Profile Search for other posts by Igor
 
jleely
Newbie
Newbie


Joined: 25 October 2016
Location: United States
Online Status: Offline
Posts: 4
Posted: 26 October 2016 at 9:57am | IP Logged Quote jleely

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 View jleely's Profile Search for other posts by jleely
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 26 October 2016 at 10:00am | IP Logged Quote Alex

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 View Alex's Profile Search for other posts by Alex
 
jleely
Newbie
Newbie


Joined: 25 October 2016
Location: United States
Online Status: Offline
Posts: 4
Posted: 26 October 2016 at 10:30am | IP Logged Quote jleely

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 View jleely's Profile Search for other posts by jleely
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 27 October 2016 at 1:46am | IP Logged Quote Alex

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 View Alex's Profile Search for other posts by Alex
 
jleely
Newbie
Newbie


Joined: 25 October 2016
Location: United States
Online Status: Offline
Posts: 4
Posted: 27 October 2016 at 9:28am | IP Logged Quote jleely

I don't think so. I am on Version 10.0.502
Back to Top View jleely's Profile Search for other posts by jleely
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 27 October 2016 at 9:39am | IP Logged Quote Alex

Zip file contains newer build.

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