Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: objSMTP CreateObject error Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
morke
Newbie
Newbie
Avatar

Joined: 31 August 2011
Location: Ireland
Online Status: Offline
Posts: 7
Posted: 01 September 2011 at 3:33am | IP Logged Quote morke

Hi,
I recently purchased MailBee.NET Objects 6.8 - 1 Developer License via Component Source. I can send emails fine, however, I cannot seem to manage to send a web page. At objSMTP = CreateObject("MailBee.SMTP") I get an error to the effect that
System.Exception was unhandled
Message=Cannot create ActiveX component.
Source=Microsoft.VisualBasic
Any assistance appreciated,
Mick O'Rourke
My Code
Imports System.IO
Imports MailBee
Imports MailBee.SmtpMail
..... Form Load, etc
...
Private Sub SendMyWebPage()
        Dim objXMLHTTP
        Dim pageURL As String = ""
        Dim objSMTP As Object ' as per mailbee
        objSMTP = CreateObject("MailBee.SMTP")
        objSMTP.LicenseKey = "MN600-8F4778E64717476E47Axxxxxx=xxxxx" '"Put your license key here"
        objSMTP.ServerName = "mail1.eircom.net" 'impactexx4.impact.local ') "mail.server.com"
        pageURL = "http://www.afterlogic.com"

        objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
Back to Top View morke's Profile Search for other posts by morke
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 01 September 2011 at 3:36am | IP Logged Quote Igor

Could you please clarify whether you are actually using ActiveX or .NET version of MailBee Objects? Also, if you encounter an error while trying to create SMTP object, how come you are successful in sending mails out? Are you saying that sometimes it works, sometimes it doesn't?

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


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 01 September 2011 at 3:40am | IP Logged Quote Igor

And in case if this is actually about using MailBee.NET Objects, this or this documentation page might be helpful.

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

Joined: 31 August 2011
Location: Ireland
Online Status: Offline
Posts: 7
Posted: 01 September 2011 at 5:09am | IP Logged Quote morke

Hi,
Thanks for the speedy reply! I was not expecting that so quickly.
Yes I am using the .net object, and you are right that was why I am getting the 'ActiveX' error.
Anyway if have got a basic version running using the code listed below.

The app I am writing is for an organisation with some 60,000 members. We have approx 20,000 valid emails, and te org wants to send them (sometimes in much smaller groupings) a web page newletter with links back to the home site.

What would be the best way to achieve this, other than looping through each email address and populating the oMailer.To.AddFromString with the individual email address and then calling the oMailer.Send for one.

My Code:
Imports System
Imports System.IO
Imports System.Text
Imports MailBee
Imports MailBee.SmtpMail
Imports MailBee.Mime
.... Load form and on button click call SendMyWebPage
Private Sub SendMyWebPage()
        Dim oMailer As Smtp = New Smtp()
        oMailer.SmtpServers.Add("impactxx2.removed.local", "usernameremoved", "pwdremoved", AuthenticationMethods.SaslLogin Or AuthenticationMethods.SaslPlain)

        oMailer.To.AddFromString("morke@removed.ie")
        oMailer.Cc.AddFromString("test@removed.ie")
        oMailer.From.AsString = "morke@removed.ie"
        oMailer.Subject = "Test web page"

        oMailer.Message.LoadBodyText("http://www.pseu.ie/index.html", MessageBodyType.Html, Encoding.Default, ImportBodyOptions.PathIsUri)
        ' ImportBodyOptions.ImportRelatedFiles) '| ImportBodyOptions.ImportRelatedFilesFromUris)
      
        Try
            oMailer.Send()
            Console.WriteLine("The message has been successfully sent.")
        Catch e As MailBeeSmtpMessageSizeOutOfRangeException
            Console.WriteLine("The message is too large (more than " + e.MaxAllowedMessageSize + " bytes).")
        End Try
    End Sub

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


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 01 September 2011 at 5:16am | IP Logged Quote Igor

Quote:
What would be the best way to achieve this, other than looping through each email address and populating the oMailer.To.AddFromString with the individual email address and then calling the oMailer.Send for one.


That's a standard approach used in such cases. There's another option, however: you can use MailBee.NET Queue so that your application saves messages as EML files to a pickup folder, and MailBee.NET Queue would ensure background delivery of those mails.

Since you already have a license for MailBee.NET Objects, you can use MailBee.NET Queue at no additional cost.

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

Joined: 31 August 2011
Location: Ireland
Online Status: Offline
Posts: 7
Posted: 01 September 2011 at 5:32am | IP Logged Quote morke

hi,
Great will be working on it over the next couple of days and will keep in touch.
Mick
Owe you a pint if you ever are in Ireland#
Back to Top View morke's Profile Search for other posts by morke
 
moonlina
Newbie
Newbie
Avatar

Joined: 08 January 2012
Location: United States
Online Status: Offline
Posts: 1
Posted: 08 January 2012 at 3:20am | IP Logged Quote moonlina

Igor wrote:
Quote:
What would be the best way to achieve this, other than looping through each email address and populating the oMailer.To.AddFromString with the individual email address and then calling the oMailer.Send for one.


That's a standard approach used in such cases. There's another option, however: you can use MailBee.NET Queue so that your application saves messages as EML files to a pickup folder, and MailBee.NET Queue would ensure background delivery of those mails.

Since you already have a license for MailBee.NET Objects, you can use MailBee.NET Queue at no additional cost.

--
Regards,
Igor, AfterLogic Support


thanks alot
Back to Top View moonlina's Profile Search for other posts by moonlina
 

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