Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

insert file text attachment in a body field

Posted on 2003-03-19
9
Medium Priority
?
229 Views
Last Modified: 2013-12-18
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 ?
0
Comment
Question by:AlainLimoges
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

by:scottrma
ID: 8168172
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.
0
 

Author Comment

by:AlainLimoges
ID: 8168319
have you a script exemple, I'm not specialist of LotuScript
0
 

Author Comment

by:AlainLimoges
ID: 8168575
have you a script exemple, I'm not specialist of LotuScript
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:AlainLimoges
ID: 8168684
have you a script exemple, I'm not specialist of LotuScript
0
 
LVL 7

Expert Comment

by:scottrma
ID: 8178697
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)

               Loop

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

          End If

     End Forall

     Set doc = col.GetNextDocument(doc)

Wend
0
 
LVL 7

Accepted Solution

by:
scottrma earned 200 total points
ID: 8178712
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.

Regards,

Scott
0
 

Author Comment

by:AlainLimoges
ID: 8179199
ok thanks a lot
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question