| Author |  | 
      
        | shaokao Newbie
 
  
  
 Joined: 08 May 2008
 Location: China
 Online Status: Offline
 Posts: 9
 | 
          
           | Posted: 19 May 2008 at 8:44pm | IP Logged |   |  
           | 
 |  like DirectSendServerConfig.RemoteEndPoint
 
 Smtp.GetMXHosts(..)
 
 I want to direct send to one of the list
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          Once you got a list of MX servers via Smtp.GetMXHosts method, you should add any of them (e.g. the first) to Smtp.SmtpServers collection and send messages through that server.
           | Posted: 20 May 2008 at 5:24am | IP Logged |   |  
           | 
 |  
 For next (another) domain, just clear the SMTP servers collection and repeat the steps above.
 
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | shaokao Newbie
 
  
  
 Joined: 08 May 2008
 Location: China
 Online Status: Offline
 Posts: 9
 | 
          what's the role of SmtpServerCollection?
           | Posted: 21 May 2008 at 11:02pm | IP Logged |   |  
           | 
 |  
 if i set ten smtp server,is it use one of them randomly?
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          If Smtp.SmtpServers contains one server, it will be used. If more than one, they will be used accordingly their priorities.
           | Posted: 22 May 2008 at 4:51am | IP Logged |   |  
           | 
 |  
 Please read SmtpServerCollection and SmtpServer.Priority documentation for details.
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | shaokao Newbie
 
  
  
 Joined: 08 May 2008
 Location: China
 Online Status: Offline
 Posts: 9
 | 
          Once you got a list of MX servers via Smtp.GetMXHosts method, you should add any of them (e.g. the first) to Smtp.SmtpServers collection and send messages through that server.
           | Posted: 04 June 2008 at 9:57pm | IP Logged |   |  
           | 
 |  
 
 i don't want to send message through that server.
 
 i just want to directly send message to that server
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          In such case you should send messages via direct send as shown in the second example here or using Smtp.QuickSend method. These method don't use a relay server for sending.
           | Posted: 04 June 2008 at 11:52pm | IP Logged |   |  
           | 
 |  
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          Also, sending through a certain SMTP server allows you to send messages to that server. If you send a message to the domain handled by that server, it's sending to, not through.
           | Posted: 05 June 2008 at 3:57am | IP Logged |   |  
           | 
 |  
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | shaokao Newbie
 
  
  
 Joined: 08 May 2008
 Location: China
 Online Status: Offline
 Posts: 9
 | 
          quicksend method can't set the target ip manually
           | Posted: 05 June 2008 at 4:42am | IP Logged |   |  
           | 
 |  
 i want to set the target server in one of the Smtp.GetMXHosts() list by manually
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          
           | Posted: 05 June 2008 at 4:49am | IP Logged |   |  
           | 
 |  
| Quote: 
 
    
    | 
      
       | Once you got a list of MX servers via Smtp.GetMXHosts method, you should add any of them (e.g. the first) to Smtp.SmtpServers collection and send messages through that server. |  |  |  
 This allows you to do what you need in case if you send to the domain handled by the target MX server. If the MX server receives a message addressed to its domain, it doesn't relay it. This is exactly what you need.
 
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  |