Emailing a picture

G

Guest

im using docmd.sendobject to send an email to my customers.

Is there anyway to add a picture to the main email body text? i have a
graphic which is a header and i want to insert it before the text.

heres my code so far:

Private Sub cmdSendInstantEmailAdvert_Click()
On Error GoTo Err_cmdSendInstantEmailAdvert_Click

Dim Company10 As String

Company10 = DLookup("[Company]", "tblCustomersAddressBook", "[CustomerID]=
Combo0")

DoCmd.SendObject acSendNoObject, , , Email, , , "Instant Email Account",
"Dear " & Company10 & "," & vbCrLf & vbCrLf & "We have noticed your using a
free email address for your business emails. Did you know that the domain
www." & Domain & " is still available to use?" & vbCrLf & vbCrLf & "Just
image you could have up to 5 professional email addresses, for example:" &
vbCrLf & vbCrLf & _
"sales@" & Domain & vbCrLf & _
"support@" & Domain & vbCrLf & _
"quotes@" & Domain & vbCrLf & _
"yourname@" & Domain & vbCrLf & _
"yourname1@" & Domain & vbCrLf & vbCrLf & _
"All this is included in our Instant Email Package, priced at only £24.99."
& vbCrLf & vbCrLf & _
"Please visit our website at
http://www.easy-to-use-databases.co.uk/Email/Email.html for more
information." & vbCrLf & vbCrLf & _
"Regards" & vbCrLf & vbCrLf & _
"The Sales Team" & vbCrLf & vbCrLf & _
"***************************************************************************************************************************************************"
& vbCrLf & _
"The information included in this e-mail is of a confidential nature and is
intended only for the addressee. If you are not the intended addressee, any
disclosure, copying or distribution by you is prohibited and may be unlawful.
Disclosure to any party other than the addressee, whether inadvertent or
otherwise is not intended to waive the privilege or confidentiality." &
vbCrLf & vbCrLf & _
"Although this email and any attachments are believed to be free from any
virus, or other defect which might affect any system into which they are
received or opened, it is the responsibility of the recipient to ensure that
they are virus free and to check that they will not adversely affect its
system and data. No responsibility is accepted by Easy To Use Databases for
any loss or damage arising in any way from their receipt, opening or use." &
vbCrLf &
"***************************************************************************************************************************************************"


Exit_cmdSendInstantEmailAdvert_Click:
Exit Sub

Err_cmdSendInstantEmailAdvert_Click:
MsgBox "Sending Email Failed"
Resume Exit_cmdSendInstantEmailAdvert_Click

End Sub


Any ideas anyone?
 
J

John Nurick

The only way I can think of doing this with SendObject would be to write
code that assembles a string containing (a) a plain text version of the
message, (b) a rich text version (RTF or HTML), (c) a suitably encoded
version of the image file and (d) the MIME headers needed to bind them
all together. This is way outside the scope of this newsgroup (not to
mention my own experience: in fact I'm not certain it would work).

That approach is certainly possible if you ignore SendObject and work
with an OLE-aware email client such as Outlook. I think you'd need to
program to the CDO 1.21 library but I'm not sure. It's also possible
using MAPI, but maybe not so simple.

Good places to look for more information are www.slipstick.com,
http://www.granite.ab.ca/access/email.htm and http://www.outlookcode.com


im using docmd.sendobject to send an email to my customers.

Is there anyway to add a picture to the main email body text? i have a
graphic which is a header and i want to insert it before the text.

heres my code so far:

Private Sub cmdSendInstantEmailAdvert_Click()
On Error GoTo Err_cmdSendInstantEmailAdvert_Click

Dim Company10 As String

Company10 = DLookup("[Company]", "tblCustomersAddressBook", "[CustomerID]=
Combo0")

DoCmd.SendObject acSendNoObject, , , Email, , , "Instant Email Account",
"Dear " & Company10 & "," & vbCrLf & vbCrLf & "We have noticed your using a
free email address for your business emails. Did you know that the domain
www." & Domain & " is still available to use?" & vbCrLf & vbCrLf & "Just
image you could have up to 5 professional email addresses, for example:" &
vbCrLf & vbCrLf & _
"sales@" & Domain & vbCrLf & _
"support@" & Domain & vbCrLf & _
"quotes@" & Domain & vbCrLf & _
"yourname@" & Domain & vbCrLf & _
"yourname1@" & Domain & vbCrLf & vbCrLf & _
"All this is included in our Instant Email Package, priced at only £24.99."
& vbCrLf & vbCrLf & _
"Please visit our website at
http://www.easy-to-use-databases.co.uk/Email/Email.html for more
information." & vbCrLf & vbCrLf & _
"Regards" & vbCrLf & vbCrLf & _
"The Sales Team" & vbCrLf & vbCrLf & _
"***************************************************************************************************************************************************"
& vbCrLf & _
"The information included in this e-mail is of a confidential nature and is
intended only for the addressee. If you are not the intended addressee, any
disclosure, copying or distribution by you is prohibited and may be unlawful.
Disclosure to any party other than the addressee, whether inadvertent or
otherwise is not intended to waive the privilege or confidentiality." &
vbCrLf & vbCrLf & _
"Although this email and any attachments are believed to be free from any
virus, or other defect which might affect any system into which they are
received or opened, it is the responsibility of the recipient to ensure that
they are virus free and to check that they will not adversely affect its
system and data. No responsibility is accepted by Easy To Use Databases for
any loss or damage arising in any way from their receipt, opening or use." &
vbCrLf & _
"***************************************************************************************************************************************************"


Exit_cmdSendInstantEmailAdvert_Click:
Exit Sub

Err_cmdSendInstantEmailAdvert_Click:
MsgBox "Sending Email Failed"
Resume Exit_cmdSendInstantEmailAdvert_Click

End Sub


Any ideas anyone?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top