Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!!!---Email body Content question.

Status
Not open for further replies.

sd110404

Programmer
Nov 3, 2004
63
US
Hi Everyone,

I am trying to send a mail frm Access on a button click.
It works very well.
I am using the following code :

Dim SubjectLine As String
Dim strFilePath As String
Dim PersonSendTo As String

PersonSendTo = "info@info.com"
SubjectLine = "My Subject"
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)

With MailOutLook
.To = PersonSendTo
.Subject = SubjectLine
.Attachments.Add "attachemntfile.htm"
.Send
End With

The above code works fine. In the attachmentfile.htm (its a 2 page text) which i want to be displayed in the body of the mail and not as attachemnt. How to do it? I tried using HTMLBody, but that i need to type in lot of text right?
Is there any easier way? And if i have to code with HTMLBody, how to simplify it?

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top