| Author |  | 
      
        | Neil_Knight Newbie
 
  
 
 Joined: 06 December 2011
 Location: United Kingdom
 Online Status: Offline
 Posts: 30
 | 
          I have the following code and I'm unsure if I'm over-setting variables, or whether I am on the right track:
           | Posted: 07 February 2012 at 3:03am | IP Logged |   |  
           | 
 |  
 
| Code: 
 
    
    | 
      
       | // Add an SMTP Server for each MX Server found
 foreach (string smtpServer in mxDomains)
 mailer.SmtpServers.Add(new SmtpServer(smtpServer));
 
 mailer.DirectSendDefaults.HelloDomain = mxServer;
 mailer.DirectSendDefaults.LocalEndPoint = new IPEndPoint(serverIP, 0);
 
 |  |  |  
 I then do a  and  after I've run through this configuration.  What I'm unsure about is, am I actually using the
 
in the Hello method, or should I be allocating this to the SmtpServer's HelloDomain?| Code: 
 
    
    | 
      
       | mailer.DirectSendDefaults.HelloDomain |  |  |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          When you're populating SmtpServers collection, direct send won't be used (unless all SMTP servers have been tried with no luck).
           | Posted: 07 February 2012 at 5:02am | IP Logged |   |  
           | 
 |  
 If you're emulating direct send manually (populating SmtpServers collection with MX servers), you'll need to set the corresponding properties (LocalEndPoint and HelloDomain) of SmtpServer object you're adding.
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Neil_Knight Newbie
 
  
 
 Joined: 06 December 2011
 Location: United Kingdom
 Online Status: Offline
 Posts: 30
 | 
          Excellent.  Thank you.  That explains why my process is failing, since I'm sending out one IP and then it's resolving to a local IP and I'm getting disconnected.
           | Posted: 07 February 2012 at 5:04am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Imux Newbie
 
  
 
 Joined: 28 October 2012
 Location: Bangladesh
 Online Status: Offline
 Posts: 1
 | 
          Yes, the problem was in DirectSend...
           | Posted: 29 October 2012 at 7:25pm | IP Logged |   |  
           | 
 |  
 | 
       
        | Back to Top |     | 
       
       
        |  |