Search The ForumSearch   RegisterRegister  LoginLogin

MailBee SMTP

 AfterLogic Forum : MailBee SMTP
Subject Topic: MailBee w/C# Coding Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Guests
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 17 August 2004 at 12:32pm | IP Logged Quote Guests

Please provide an example that illustrates how to use the MailBee control with Microsoft's C# language and the Visual Express development environment.
Back to Top View Guests's Profile Search for other posts by Guests
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 17 August 2004 at 1:11pm | IP Logged Quote Alex

static void Main(string[] args)
{
MailBee.SMTP objSMTP;

objSMTP = new MailBee.SMTPClass();
objSMTP.LicenseKey = "your key here";

// use SMTP authentication
objSMTP.AuthMethod = 2;
objSMTP.ServerName = "mail.server.com";
objSMTP.UserName = "username";
objSMTP.Password = "password";
objSMTP.Message.FromAddr = "from@domain1.com";
objSMTP.Message.ToAddr = "to@domain2.com";
objSMTP.Message.Subject = "Test";
objSMTP.Message.BodyText = "<html>Body</html>";
objSMTP.Message.BodyFormat = 1;
if (objSMTP.Send() == true)
{
    Console.WriteLine("Sent successfuly.");
}
else
{
    Console.WriteLine("Error: " + objSMTP.ErrCode);
}
}

This sample sends test html message with SMTP authentication enabled.

Also, before typing the code, make sure to add a reference to MailBee library first: go to "Project/Add reference" menu, click "COM" tab and check MailBee library in the list.


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

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