By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

Sending email with attachment

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
This article show you how.

http://www.trainingon.net/Articles/TIP0002.htm

--
Terry Burns
http://TrainingOn.net

"ReidarT" <re****@eivon.no> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #2

P: n/a
Hi,

butnSendMail.Enabled = False

Try

Dim LMsg As New Indy.Sockets.IndyMessage.Message

LMsg.From.Text = textFrom.Text.Trim()

LMsg.Recipients.Add().Text = "Ke*@Onteorasoftware.com"

LMsg.Subject = textSubject.Text.Trim()

LMsg.Body.Text = textMsg.Text

Dim indyFile As New _

Indy.Sockets.IndyAttachmentFile.AttachmentFile(LMs g.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

-----------------------

"ReidarT" <re****@eivon.no> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.