473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Sending email with attachment

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
2 1029
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
5
by: morphex | last post by:
Hi, I have an email that's in the utf-8 encoding, and I'm getting this error message when I try to send it using smtplib: * Module smtplib, line 688, in sendmail * Module smtplib, line 485,...
7
by: Marcin | last post by:
Hello all! A few years ago I created a form with button which let me send an email with an attachment. It was created in Access 97. Now I would like to move this application into Access 2003....
0
by: Dragos Marian Barbu | last post by:
Recently I tried to develop a function to help me sending e-mail messages with more than one attachment. Everything is working OK when I am sebding messages with one attachment, but when I try to...
6
by: Anuradha | last post by:
Dear All How can i send mails using vb.net Thanx all
6
by: Rushwire | last post by:
Does anybody know how to send a meeting request using an ics/vcs (VCalendar) attachment from an asp.net page. I don't want my users to have to double click on the attachment but rather that it is...
0
by: damimkader | last post by:
Hi, I'm trying to send emails using a Macro based on an Excel Sheet and the Email Client I'm using is Lotus Notes. OS used - Windows Xp. Language - VB Below is the Code I'm using for doing...
7
by: Paridevi | last post by:
Hai , i want to send email in .Net Using OutLook Express,My Project is Web Application using vb.Net 2003 with SQL Server 2000.I have searched a lot in Google, but ican't get any...
3
by: raj200809 | last post by:
when i m sending mail i received error from symantec Antivirus" Your email message was unable to be sent because your mail server rejected the message 550-5.7.1 the ip you’re using to send mail is...
3
by: virtualweb | last post by:
Hello: I need to send a bit of HTML and Javascrpt on the body of an email from my perl script in order to have the recipient get a link that will openup a new window with a PopUp. For some...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.