Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET Objects

 AfterLogic Forum : MailBee.NET Objects
Subject Topic: SSL/TSL (Second Domain) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
stevewhite
Newbie
Newbie


Joined: 28 May 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 28 May 2008 at 7:04am | IP Logged Quote stevewhite

I am running into a problem when sending to multiple domains and a prior domain is TLS. As a background this is what I am doing.

I am sending a message to one domain at a time, as I need to direct send. If the domain I send to first is TLS then I go throught the TLS process. I then, using the same smtp object, resetmessage, clear DnsServers and SmtpServers then call DnsServers.AutoDetect.

When sending to the second domain it gives me a "At least one SMTP server must be specified in order to send to relay server." exception.

Is there a property I have to reset that I am missing.

If I flip the order of the recipients and send to the non tls domain first, everything works fine.

Thanks,

Back to Top View stevewhite's Profile Search for other posts by stevewhite
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 28 May 2008 at 7:26am | IP Logged Quote Alex

Could you provide us with a simple and self-contained example which would allow us to immediately run it and reproduce the problem?

You can send it through our Request Support Form (assuming it may contain private information like real e-mail addresses).

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
stevewhite
Newbie
Newbie


Joined: 28 May 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 29 May 2008 at 6:41am | IP Logged Quote stevewhite

Alex,
I have sent a sample via the support form.

Thanks,
Steve
Back to Top View stevewhite's Profile Search for other posts by stevewhite
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 29 May 2008 at 7:06am | IP Logged Quote Alex

The sample recived, thank you. We'll contacxt you via e-mail shortly.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 29 May 2008 at 7:21am | IP Logged Quote Alex

Adding Smtp.ResetState() prior to calling Smtp.Send() second time eliminated the issue.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
stevewhite
Newbie
Newbie


Joined: 28 May 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 25 June 2008 at 2:09pm | IP Logged Quote stevewhite

Alex,
That worked great, however I now have a new problem.

I need to work more within the confines of MailBee. That is to say, rather than looping through each domain, I would rather take advantage of MailBee as the relay server. However, a new problem with Tls is rearing it's head.

How can I send to multiple domains, through one call to Send, and make sure that one or more of the domain's messages are delivered with Tls enabled?

Any help would be much appreciated.

Thanks
Back to Top View stevewhite's Profile Search for other posts by stevewhite
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 26 June 2008 at 12:29am | IP Logged Quote Andrew

If your application sends messages directly to recipients SMTP servers, it acts as an MX server. MX servers never use SSL/TLS for sending messages, moreover, they always connect/listen to port 25. Secure connections can be established between a relay SMTP server and a client e-mail software only.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
stevewhite
Newbie
Newbie


Joined: 28 May 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 26 June 2008 at 7:04am | IP Logged Quote stevewhite

Another follow up question.

I understand that using DnsServers.Autodetect is going to send through port 25 without Tls.

I still need to be able to send to multiple domains, some with Tls, some without, without losing the distribution list. I know I can strip out the email addresses for the other domains and call send for each domain, but then I lose the distribution list in the header.

I have tried to manually add the To header for the other recipients, via Message.Header.Add, not for that domain, but it seems to override the Message.To collection.

Problem is that specific clients expect Tls delivery and others don't.

If I loop through the domains without modifying the distribution list, I end up with multiple messages delivered to each recipient.

Back to Top View stevewhite's Profile Search for other posts by stevewhite
 
stevewhite
Newbie
Newbie


Joined: 28 May 2008
Location: United States
Online Status: Offline
Posts: 6
Posted: 26 June 2008 at 8:02am | IP Logged Quote stevewhite

I think that we have figured this one out.

I was modifying the header in the wrong place, before the call to Send. I added an EventHandler on SendingMessage that replaces the To and Cc headers with the full distribution list.

This is done here, after the call to GetAllRecipients.

If you see any issue with this please let me know.

Thanks,
Steve
Back to Top View stevewhite's Profile Search for other posts by stevewhite
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 27 June 2008 at 12:14am | IP Logged Quote Andrew

If we understood you correctly, you need to send messages to an address list different from what's specified in To/Cc/Bcc headers. This can be easily done via this or this overload of Smtp.Send method. The second parameter accepts recipients list the message will be actually sent to.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide