insert file text attachment in a body field

I receive mails with file TXT attachments
I want to modify the body field of this mail by adding the content of this TXT file attachment

any idea ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You could write a new mail agent to look for .txt file attachments in your incoming mail, and if they are found, detach them, then read their contents into memory and write (append) the contents to the Body field of the email.
AlainLimogesAuthor Commented:
have you a script exemple, I'm not specialist of LotuScript
AlainLimogesAuthor Commented:
have you a script exemple, I'm not specialist of LotuScript
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

AlainLimogesAuthor Commented:
have you a script exemple, I'm not specialist of LotuScript
Set s = New NotesSession
Set db = s.CurrentDatabase
Set col = db.UnprocessedDocuments
Set doc = col.GetFirstDocument

While Not (doc Is Nothing)

     Forall o in doc.EmbeddedObjects

          If o.Type = EMBED_ATTACHMENT And Lcase$(Right$(o.Name,4)) = ".txt" Then

               s.ConvertMime = True
               Set body = doc.GetFirstItem("Body")

               FilePath$ = "C:\temp\" & o.Name
               Call o.ExtractFile(FilePath$)
               FileNum% = FreeFile()
               Open FilePath$ For Input As FileNum%

               Do While Not EOF(FileNum%)

                    Line Input #FileNum%,temp$
                    Call body.AppendText(temp$)
                    Call body.AddNewLine(1)


               Call doc.Save(True,False)
               Close #FileNum%
               Kill FilePath$

          End If

     End Forall

     Set doc = col.GetNextDocument(doc)

Put the above into a new mail agent in your mail database. Whoever saves the agent (that's you) must be listed in the "Allowed to run unrestricted LotusScript agents" field in the Server document for the server where your mail file is hosted. In the example above I have set C:\temp\ as the temporary folder where the detached files will be stored and read from. After reading their contents and appending them to the body of the mail, the detached files are deleted. The folder C:\temp\ must exist ON THE SERVER, not the client, otherwise the script will generate an error.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlainLimogesAuthor Commented:
ok thanks a lot
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.