The recipient does not receive email messages that a Microsoft Dynamics CRM user sends by using the Microsoft Dynamics CRM web client


Symptoms


The Microsoft Dynamics CRM 3.0 web client

When a Microsoft Dynamics CRM user sends an email message by using the Microsoft Dynamics CRM 3.0 web client, the recipient does not receive the email message. This problem occurs when the following conditions are true:
  • The Microsoft Dynamics CRM server components and Microsoft Exchange Server are installed on separate servers.
  • During the installation of the Microsoft Dynamics CRM server components, you type the name of the Exchange server as the incoming Simple Mail Transfer Protocol (SMTP) server name and as the outgoing SMTP server name.
  • The Microsoft Dynamics CRM server has a local SMTP service installed.
Note On the Microsoft Dynamics CRM server, you can see the unresolved email messages in the following directory:
C:\Inetpub\mailroot\Badmail
Additionally, you may receive the following error message:
"Failed to Initialize Token" Initialize Token FailureT

The Microsoft Dynamics CRM 4.0 or Microsoft Dynamics CRM 2011 web client

When a Microsoft Dynamics CRM user sends an email message by using the Microsoft Dynamics CRM 4.0 or Microsoft Dynamics CRM 2011 web client, the email message is sent or queues up. However, if an issue occurs when the user sends the email message, the user receives one of the following error messages in the email activity.

Error message 1
This message has not yet been submitted for delivery. 1 attempts have been made so far.
Error message 2
The message delivery failed. It must be resubmitted for any further processing.
Additionally, you receive an error message that resembles the following in the MSCRMEmailLog event log:
Event Type:Error

Event Source:MSCRMEmailLog

Event Category:None

Event ID:0

Date:Date
Time:Time
User:N/A

Computer:ComputerName
Description: #61042 - An error occurred while processing the outgoing e-mail message with subject "test 3 today CRM:0001011" for SMTP: http://adsrv:81/MS1 for delivery through adsrv. System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)

at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)

at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)

--- End of inner exception stack trace ---

at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)

at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)

at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)

at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)

at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)

at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)

at System.Net.Mail.SmtpClient.GetConnection()

at System.Net.Mail.SmtpClient.Send(MailMessage message)

--- End of inner exception stack trace ---

at System.Net.Mail.SmtpClient.Send(MailMessage message)

at Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider.SendMessage(MailMessage mailMessage)

at Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider.ProcessMessageInternal(email emailMessage)

at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.ProcessMessage(email emailMessage)

at Microsoft.Crm.Tools.Email.Providers.CrmPollingSendEmailProvider.Run()



For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Cause


Microsoft Dynamics CRM relies on the local SMTP server to forward email messages to the Exchange server. This problem occurs for one of the following reasons:
  • The SMTP configuration on the Microsoft Dynamics CRM server is not configured to forward email messages to the Exchange server.
  • The Exchange server is not configured to allow relay messages from the Microsoft Dynamics CRM server.

Resolution


To resolve this problem, follow these steps.

Step 1: Configure SMTP on the Microsoft Dynamics CRM server to forward email messages to the Exchange server

  1. On the Microsoft Dynamics CRM server, open Internet Information Services (IIS). To do this, click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. In Internet Information Services (IIS) Manager, expand Default SMTP Virtual Server, right-click Domains, point to New, and then click Domain.
  3. In the New SMTP Wizard, click Remote under Specify the domain Type, and then click Next.
  4. Type your domain name in the Name box, and then click Finish.
  5. In the right pane, right-click the domain name that you added in steps 2 through 4, and then click Properties.
  6. On the General tab, click to select the Allow incoming mail to be relayed to this domain check box, and then click Forward all mail to smart host. In the box under Forward all mail to smart host, type the Exchange server name, and then click OK.
  7. Restart the SMTP service on the Microsoft Dynamics CRM server. To do this, click Start, click Administrative Tools, and then click Services. Right-click Simple Mail Transfer Protocol (SMTP), and then click Restart.

Step 2: Configure the Exchange server to allow relay messages from the Microsoft Dynamics CRM server

Exchange Server 2003

If you are using Microsoft Exchange Server 2003, you must first configure the Relay Restrictions and then verify the Connections Control.
Configure the Relay Restrictions
  1. Click Start, point to Programs, point to Microsoft Exchange, and then click System Manager.
  2. Click Servers, click the name of the Exchange server, click Protocols, and then click SMTP.
  3. Right-click Default SMTP Virtual Server, click Properties, and then click the Access tab.
  4. In the Relay Restrictions area, click Relay.
  5. Verify that the Only the list below option is selected, and then add the Microsoft Dynamics CRM server to the list.

    If you are using Microsoft Dynamics CRM 4.0 or Microsoft Dynamics CRM 2011, make sure you add the server that has the Exchange router installed to the list.
  6. Restart the SMTP service. To do this, follow these steps:
    1. Click Start, point to Programs, point to Administrative Tools, and then click Services.
    2. Right-click Simple Mail Transfer Protocol (SMTP), and then click Restart.
Verify the Connections Control
  1. Click Start, point to Programs, point to Microsoft Exchange, and then click System Manager.
  2. Click Servers, click the name of the Exchange server, click Protocols, and then click SMTP.
  3. Right-click Default SMTP Virtual Server, click Properties, and then click the Access tab.
  4. In the Connections Control area, click Connection.
  5. By default, the All except the list below option is selected. If the Microsoft Dynamics CRM server is added to this list, you must contact the Exchange administrator to determine the reason that the Microsoft Dynamics CRM server was added.

    Note For Microsoft Dynamics CRM email messages to work correctly, the Microsoft Dynamics CRM server must be able to connect to the Exchange server.
  6. If the Only the list below option is selected, you must add the Microsoft Dynamics CRM server to the list to allow it to connect to the Exchange server.
  7. If you made any changes to the Connection Control settings, restart the SMTP service. To do this, follow these steps:
    1. Click Start, point to Programs, point to Administrative Tools, and then click Services.
    2. Right-click Simple Mail Transfer Protocol (SMTP), and then click Restart.

Exchange Server 2007

If you are using Microsoft Exchange Server 2007, you must create a new Exchange receive connector, configure the connector for the anonymous user, configure protocol permissions for the receive connector, and then restart the Microsoft Exchange Transport Service on the Exchange server.
Create an Exchange receive connector
  1. Open the Exchange Management Console.
  2. Expand Server Configuration.
  3. Click Hub Transport.
  4. Right-click Receive Connectors, and then click New Receive Connector.
  5. Type a name in the Name box.
  6. In the Select the intended use for this Receive connector list, click Internal, and then click Next.
  7. In the Remote Network Settings section, click Add, and then type the IP address of the Microsoft Dynamics CRM server.


    Note If you see the value 0.0.0.0-255.255.255.255, click Delete.
  8. Click Next, click New, and then click Finish.
Configure the connector for the anonymous user
  1. Right-click the Exchange receive connector that you created, and then click Properties.
  2. Click the Permission Groups tab.
  3. Make sure that the Specify who is allowed to connect to the Receive connector option is set to Anonymous users, click Apply, and then click OK.
Configure protocol permissions for the receive connector
Note You must have Windows Support Tools installed to complete these steps. Only an experienced administrator should use the Adsiedit.msc tool.
  1. Start the Adsiedit.msc tool.
  2. Expand Configuration, expand Services, expand Microsoft Exchange, expand CN= First Organization, expand Administrative Groups, expand Exchange Administrative Group, expand Servers, expand Protocols, and then expand SMTP Receive Connectors.
  3. Right-click the Exchange receive connector that you created, and then click Properties.
  4. Click the Security tab.
  5. Click Anonymous Logon.
  6. Click to select the Submit Messages to any Recipient check box and the Accept Authoritative Domain Sender check box, click Apply, and then click OK.
Restart the Microsoft Exchange Transport Service on the Exchange server
  1. Click Start, click Run, type services.msc, and then click OK.
  2. Right-click Microsoft Exchange Transport Service, and then click Restart.

References


For more information about how to troubleshoot incoming and outgoing email issues, visit the following Microsoft TechNet website:For more information about how to allow application servers to relay off Exchange Server 2007, visit the following Microsoft website: