Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Send Email via SMTP using CLR Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
cmoozilla
Newbie
Newbie


Joined: 23 November 2011
Location: Canada
Online Status: Offline
Posts: 9
Posted: 11 October 2013 at 4:38am | IP Logged Quote cmoozilla

Hi,

We have been using Mailbee.NET for some time and for the most part it is working great.

We are accessing the .net component through CLR from within Dynamics AX.

We have been using the quicksend method to send most emails, however some external email servers are blacking our emails and flagging them as spam.

We are now attempting to send emails using one of our customers email servers. The customer has provided us with the server name, id, password, ports, etc...

So here is the issue:

When accessing the smtp .net object using CLR, I cannot determine how to add the smtp server collection to the smtp object.

Here is a sample of the code:

    MailBee.SmtpMail.Smtp                   mailer;
    MailBee.Mime.EmailAddress               fromAddress;
    MailBee.Mime.EmailAddress               toAddress;
    MailBee.Mime.EmailAddressCollection     toCollection;
    MailBee.SmtpMail.SmtpServer             mailServer;
    MailBee.SmtpMail.SmtpServerCollection   mailServerCollection;
    ;
    Mailer = new MailBee.SmtpMail.Smtp();
    
    fromAddress = new MailBee.Mime.EmailAddress('chris.moore@trackernetworks.com','Chris Moore');
    mailer.set_From(fromAddress);

    toAddress = new MailBee.Mime.EmailAddress('chris.moore@trackernetworks.com','Chris Moore');
    toCollection = new MailBee.Mime.EmailAddressCollection();
    toCollection.Add(toAddress);
    mailer.set_To(toCollection);
    
    mailServer = new MailBee.SmtpMail.SmtpServer();
    mailserver.set_AccountName('test');
    mailserver.set_AccountDomain('test');
    mailserver.set_Password('password');
    
    mailServerCollection = new MailBee.SmtpMail.SmtpServerCollection();
    mailServerCollection.Add(mailServer);


At this point I think I should be able to tell the mailer to use the server collection I have created, but I can't seem to find the method to do this.

Below is a screen shot of the methods I have available within AX, no add_smtpServer method... There is get_smtpServers method which returns the current server collection.

http://www.pricetrackerdata.com/mailbee_clr.jpg

Any ideas would be greatly appreciated.

Thanks

Chris


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

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 11 October 2013 at 5:06am | IP Logged Quote Alex

Smtp object has SmtpServers property which has SmtpServerCollection type. Just use mailer.SmtpServers.Add(mailServer) to populate the collection.

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


Joined: 23 November 2011
Location: Canada
Online Status: Offline
Posts: 9
Posted: 11 October 2013 at 5:51am | IP Logged Quote cmoozilla

Hi Alex,

For some reason my MailBee.SmtpMail.Smtp object does not have the SmtpServers property...

http://www.pricetrackerdata.com/mailbee_clr.jpg

I'm accessing the .NET component through CLR, which wraps the calls.

Can you help?

Chris
Back to Top View cmoozilla's Profile Search for other posts by cmoozilla
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6043
Posted: 11 October 2013 at 5:57am | IP Logged Quote Igor

It's probably called something else; unlike other properties, this one represents a collection. Please check the entire list of properties carefully, it should be there somewhere.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
cmoozilla
Newbie
Newbie


Joined: 23 November 2011
Location: Canada
Online Status: Offline
Posts: 9
Posted: 11 October 2013 at 6:59am | IP Logged Quote cmoozilla

Hi Alex,

here is a pic of the complete list I am seeing...

http://www.pricetrackerdata.com/mailbee_clr_complete_list.jpg

Can you tell me which one to use?

Chris
Back to Top View cmoozilla's Profile Search for other posts by cmoozilla
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6043
Posted: 11 October 2013 at 7:20am | IP Logged Quote Igor

As far as I can see, it is there:



--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
cmoozilla
Newbie
Newbie


Joined: 23 November 2011
Location: Canada
Online Status: Offline
Posts: 9
Posted: 11 October 2013 at 7:34am | IP Logged Quote cmoozilla

Hi,

Yes I see that, that would get the current SMTP server collection, I am trying to set the server collection, there is no corresponding function to set the smtp server collection.

Chris
Back to Top View cmoozilla's Profile Search for other posts by cmoozilla
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6043
Posted: 11 October 2013 at 7:39am | IP Logged Quote Igor

That's the only property of such kind and it is read-only, you can't set it directly. The collection has Add method you need to use for adding items to it.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
cmoozilla
Newbie
Newbie


Joined: 23 November 2011
Location: Canada
Online Status: Offline
Posts: 9
Posted: 11 October 2013 at 9:59am | IP Logged Quote cmoozilla

Hi Igor,

Yes that is what I am trying to do... Add a smtp Server.

I don't see how it can be done... Is there any chance we can share screens and I can show you what I am experiencing?

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

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 11 October 2013 at 10:10am | IP Logged Quote Alex

In C#, it's something like
Code:
mailer.SmtpServers.Add(server)

or
Code:
mailer.SmtpServers.Add("servername", "user", "passw")

I guess in your language it would be somewhat like
Code:
mailer.get_SmtpServers().Add(server)

or
Code:
mailer.get_SmtpServers().Add("servername", "user", "passw")

I don't see any rocket science here. Am I missing something?

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


Joined: 23 November 2011
Location: Canada
Online Status: Offline
Posts: 9
Posted: 11 October 2013 at 10:25am | IP Logged Quote cmoozilla

I agree, it's not rocket science!

From my environment there is no .Add(server) function available.

From the list of functions available:

http://www.pricetrackerdata.com/mailbee_clr_complete_list.jpg

You think there would be a "set_serverCollection()" function to set the servers, but it is not listed anywhere.

the get_smtpServer just returns a serverCollection, does not allow you to add a server.

Please let me know what else I can look at, i'm stumped!

Chris


Back to Top View cmoozilla's Profile Search for other posts by cmoozilla
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6043
Posted: 14 October 2013 at 1:36am | IP Logged Quote Igor

Quote:
You think there would be a "set_serverCollection()" function to set the servers


No, it's not going to work that way with read-only collections. The only option there is to use Add method for it.

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

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