Skip to main content
Troubleshooting mail issues

You may run into a number of issues when attempting to send e-mails from K2.net . K2.net uses the .NET fx to send SMTP e-mail messages to any SMTP server, regardless of product or platform.

This article covers the steps you can take to make it work.

  • 1. Verify that all e-mail addresses specified are valid.
    • The
From address may not contain any spaces and in some instances it must be a valid address as well (that has its own mailbox).
If you use data/XML fields to store addresses, make sure that the fields contain the correct data. Write the values to the console to verify.
2. If you do not explicitly specify e-mail addresses, verify that the user that you are sending the mail to has an e-mail address in your underlying user store. If you use Microsoft s Active Directory, the user object must have an e-mail address specified on the General tab of the user object s properties. Note that this field is the only one queried for the user's email address, even if you have Exchange info specified for the user.

3. During the K2.net installation you can specify a default SMTP server name. This value is stored in the K2Server.config file in the DefaultSMTPServer element s Server attribute. Verify that this value is correct.

4. If a value has been specified for the SMTP Server in a client event s SMTP Notification Message setup or in a Server Mail event s setup, this value will be used instead of the default value. Verify that the value specified for the SMTP Server is correct.

5. If no value has been specified in the K2.net setup or in the event, the .NET fx class System.Web.Mail.SmtpMail will attempt to locate the mail exchanger from your DNS server. You can check this manually by issuing the following command:
  • nslookup -type=mx domain
    e.g. nslookup -type=mx k2workflow.com
    Inspect the output and locate the mail exchanger
    For more info on nslookup on Windows XP, check out
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nslookup.mspx and http://support.microsoft.com/default.aspx?kbid=200525
SMTP mail can be sent to this SMTP server
Note that you can also configure the Microsoft SMTP service and send mail to it. It will also send the mail to the mail exchanger, unless a smart host has been configured.
6. Now that you know where the mail will be sent, you can test the sending process manually. Follow these steps:
  • Open a command prompt
    Type "telnet mailservernameORipaddress 25",
    e.g. telnet 172.85.65.23 25, or telnet exchsrv 25
    You can use the FQDN or NetBIOS name of the server.
    Your SMTP server should be listening on port 25
    Your mail server will answer with something like:
regsvr32 "c:windowssystem32cdosys.dll"

The From address may not contain any spaces and in some instances it must be a valid address as well (that has its own mailbox).


Please could you tell me why this is so? I want to create a data field in my process that I can use as a standard FROM field for all notifications within the process.

You may use a data field, as long as it does not contain any spaces in the value. So you can specify any of the following values:
  • K2
    K2@k2workflow
    K2@k2workflow.com
    any datafield that has a value like any of the above


You may not use the following:
  • K2 Server
    K2 Server@k2workflow
    K2 Server@k2workflow.com
    any datafield that has a value like any of the above


This is simply due to the fact that any SMTP email address may not contain spaces. K2 uses the System.Web.Mail.SMTPMail class to send email and this class will raise the exception.
It's good to see the telnet method of testing smtp in use. One thing to note is that if you make a mistake you must redo the whole line as ^H and backspace don't work properly in the MS telnet client, putty is a good alternative for testing.
Also bear in mind that RCPT TO: and FROM: constraints will change from server to server.

As will the HELO requirments. These can all lead to more issuse with sending mail.

Reply