rename e-mail attachement

Looking for a way to rename a e-mail attachement.

In the incoming data i have 2 fields:

attfile and attname

to make a attachment i use a script:

var att = record.fields.attfile;

results.append(“link rel=‘related’ href='”+att+“'>”;

if the attfile recordfield is [\serv1\share1\tmp12345.pdf](file://serv1/share1/tmp12345.pdf) then i get a e-mail with attachementname tmp12345.pdf.

I want to rename that to the value in recordfield attname (info.pdf)

It sounds like this is equivalent to renaming a file on disk. You can achieve this in the Workflow either with a VBScript or using the Workflow tools such as Folder Capture and Send To Folder actions and save the renamed files into a separate folder before attaching them to your emails.