soderlind.no

I code for fun

19.5.2004
by PerS
0 comments

Indy followup – How to send a simple text email message

//The following code is the basic structure for constructing a message:
Indy.Sockets.IndyMessage.Message LMsg = new Indy.Sockets.IndyMessage.Message();

LMsg.From.Text = AFrom;
LMsg.Recipients.Add().Text = ATo;
LMsg.Subject = ASubject;
LMsg.Body.Text = AMsg;

SMTP LSMTP = new SMTP();
LSMTP.OnStatus += new Indy.Sockets.IndyComponent.TIdStatusEvent(SMTPStatus);
LSMTP.Host = “mail.domain.tld”;
LSMTP.Connect();

try {
LSMTP.Send(LMsg);
Status(“Completed”);
}

finally {
LSMTP.Disconnect();
}

more …

23.1.2004
by PerS
0 comments

Object-Relational Persistence for .NET

This is cool:
“With SQL Server Yukon, you could do the following:

CREATE TABLE [dbo].[Person] (
   [Id] [int] IDENTITY (1, 1) NOT NULL ,
   [Person] [Person] NOT NULL
) ON [PRIMARY]

The Person type is a .NET class. Columns in Yukon can be typed to custom .NET classes.”

more …