Sending scheduled emails

ActiveQ

Sending scheduled emails

 

Like standard queued email, the task is pretty easy. To schedule your mail, just set the Date of the email explicitly (this feature is not available in all mail components) :

 

Using C#

 

Message message = new Message();

message.From = new Address("[email protected]","John Doe");

message.To.Add("[email protected]","Mike Johns");

message.Subject = "hey!";

message.Attachments.Add("C:\\myfile.doc");

message.BodyHtml.Text = "As promised, the requested document.<br /><br />Regards,<br />John.";

message.Date = new DateTime(2003, 12, 25, 11, 12);

message.StoreToFile("C:\\messages\\outbox\\tobesent.eml", true);

 

Using VB.NET

 

Dim message As New Message

message.From = new Address("[email protected]","John Doe")

message.To.Add("[email protected]","Mike Johns")

message.Subject = "hey!"

message.Attachments.Add("C:\myfile.doc")

message.BodyHtml.Text = "As promised, the requested document.<br /><br />Regards,<br />John."

message.Date = new DateTime(2003, 12, 25, 11, 12)

message.StoreToFile("C:\messages\outbox\tobesent.eml", true)

 

ActiveQ will load the email when available and add it to its scheduled queue for later processing. In the example above, ActiveQ will automatically send the email on December 25th, 2003 at 11:12 am

 

 

Copyright © 2003 Active Up SPRL - All Rights Reserved - http://www.activeup.com