Archived Forum Post

Index of archived forum posts


Attachments within a 'service'

Mar 31 '14 at 14:21

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?



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.