login about faq

Hi there,

When added an embedded image + attachment using the following code, all works perfectly well. But if I run my application as a 'service' (using InstSrv and Srvany), the email still sends, but minus any attachments.

The service is running as a 'System Account' (with 'Interact with Desktop' set,

If Dir(Environment.CurrentDirectory & "AutoRunReport.png") <> "" Then cid = mail.AddRelatedFile(Environment.CurrentDirectory & "AutoRunReport.png") Else cid = ""

NOTE: that the above checks for the file's presence, so therefore the application must have rights to that folder.

mail.AddFileAttachment("c:program files (x86)novalogipmydoc.xml")

Any ideas?

asked Mar 28 '14 at 09:50

PaulMcGuinness's gravatar image


(Note the post 'ate' the slashes - the pathnames are correct)

and I'm thinking it might be to do with 'temporary files' as the 'System' Context doesn't have a temp file folder (as far as I know...)

(Mar 31 '14 at 03:27) PaulMcGuinness


My only advice is to get more information about what happened, and to do that you would turn on verbose logging in the LastErrorText by setting the email.VerboseLogging property = true (or 1/YES) for some programmming languages, and then examine the contents of the email.LastErrorText after calling AddFileAttachment.


answered Mar 31 '14 at 14:21

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Mar 28 '14 at 09:50

Seen: 1,451 times

Last updated: Mar 31 '14 at 14:21

powered by OSQA