Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » After switch to Kerio, Mail sending doesn't work (.NET)

Messages: 6
Karma: 0
Send a private message to this user
We always used this function, it's ASP.NET v2


public static bool SendMail(string Subject, string Body, string ToAddress)
System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("xx");
MailAddress FromAddress = new MailAddress("xx", "xx");
MailAddress ToAddr = new MailAddress(ToAddress, ToAddress);
MailMessage message = new MailMessage(FromAddress, ToAddr);

message.Subject = Subject;
message.Body = Body;

client.Credentials = new System.Net.NetworkCredential("xx", "xx");
return true;

Since we use Kerio as Mail Demon, we get the following exception:

"Failure sending mail."
"Das Token, das der Funktion übergeben wurde, ist ungültig"

Which means something like "The token, which was delivered to the function, is invalid".

What could that be?

Messages: 6
Karma: 0
Send a private message to this user
It really seems to be a problem of Kerio, because all other E-Mail Demons work, please fix this..
Pavel Dobry (Kerio)

Messages: 5245
Karma: 251
Send a private message to this user
Please tell us what are you sending to SMTP server. It would be great if you could enable SMTP server option in the debug log in Admnistration Console to enable debug logging of SMTP server.

Messages: 6
Karma: 0
Send a private message to this user
[13/Apr/2006 10:37:05][2276] {smtps} Sent SMTP greeting to
[13/Apr/2006 10:37:05][2276] {smtps} Command EHLO andy
[13/Apr/2006 10:37:05][2276] {smtps} Sent reply to EHLO: 250 ...
[13/Apr/2006 10:37:05][2276] {smtps} Command AUTH ntlm TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAFASgKAAAADw==
[13/Apr/2006 10:37:05][2276] {smtps} Started authentication method ntlm
[13/Apr/2006 10:37:05][2276] {smtps} Authentication aborted by client
[13/Apr/2006 10:37:05][2276] {smtps} SMTP server session end
[13/Apr/2006 10:37:09][1440] {smtps} SMTP server session end

And here's the function in MSDN: redential(VS.80).aspx


Messages: 462
Karma: 0
Send a private message to this user

Just to double-check you have NTLM authentication turned on in KMS and tried NTLM authentication with KMS via some other means, right?

Does your code throw any exceptions? Seems like new NetworkCredential() should be throwing some exception.

Also, you might turn tracing on. The smtps debug logs don't seem to provide much info in this situation, except that the ASP.NET app is aborting during authentication before it sends the message.

Your code looks proper, though.

Kerio MailServer 6.7.1 w/AD
Windows Server 2003 SP 1
Dell PowerEdge 2850 (Dual Xeon 3.2ghz and 2 GB RAM)
~1300 users
~1000+ concurrent IMAPS connections
iPhone users
Outlook 2007 KOFF users
Apple iCal 10.5/10.6 users
Previous Topic: IMAP GETQUOTA
Next Topic: Blank emails
Goto Forum:

Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Tue Nov 21 18:14:00 CET 2017

Total time taken to generate the page: 0.00383 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.