Author |
|
Guests Guest Group
Joined: 10 November 2003
Online Status: Online Posts: 262
|
Posted: 17 August 2004 at 12:32pm | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 17 August 2004 at 1:11pm | IP Logged
|
|
|
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 |
|
|