Hi,
butnSendMail.Enabled = False
Try
Dim LMsg As New Indy.Sockets.IndyMessage.Message
LMsg.From.Text = textFrom.Text.Trim()
LMsg.Recipients.Add().Text = "(e-mail address removed)"
LMsg.Subject = textSubject.Text.Trim()
LMsg.Body.Text = textMsg.Text
Dim indyFile As New _
Indy.Sockets.IndyAttachmentFile.AttachmentFile(LMsg.MessageParts, _
"C:\test.txt")
Dim LSMTP As New SMTP
AddHandler LSMTP.OnStatus, AddressOf SMTPStatus
LSMTP.Host = "sendmail.YourServer.com"
LSMTP.Username = "UserName"
LSMTP.Password = "YourPassword"
LSMTP.Connect()
Try
LSMTP.Send(LMsg)
Status("Completed")
Finally
LSMTP.Disconnect()
End Try
Finally
butnSendMail.Enabled = True
End Try
Ken
-----------------------
I got som pretty good help with code for sending emails to 3 persons from
Ken Tucker.
What I miss now is how to send an attachment with the email.
regards
reidarT