2

I'm trying to make a button in IBM Notes that automatically forwards emails with attachments to a specific address.

I have looked at 2 previous examples on this website but none of them are working for me and I get the mail forwarded to myself.

Can anyone help?

The 2 codes I've tried are:

_From := @Text(From);
@Command([MailForward]);
@Command([EditNextField]);
@Command([EditInsertText]; _From);
@Command([EditGotoField]; "Body");
@Command([EditInsertText]; "Your text" + @NewLine + "goes here...")

and

FIELD SendTo:= "person@mail.com" ; 
@Command( [MailForwardAsAttachment] )

The IBM Notes version I'm using is # 9.

Thank you

Adrian
  • 25
  • 2

1 Answers1

0

Use the first example and change it to:

@Command([MailForward]);
@Command([EditInsertText]; "person@mail.com");
@Command([EditGotoField]; "Body");
@Command([EditInsertText]; "Your text" + @NewLine + "goes here...")

Replace the email address in second code line with your specific address and adapt the remaining lines too.

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • Thanks a lot! Is there also a way to have the mail sent automatically when I press the button without people having to press on the 'send' button? – Adrian Feb 08 '21 at 07:42
  • You can add `@Command([FileCloseWindow])`. It would then need just one click for user to send the email. In case you'd like to have a solution without any user interaction you could write a mail-in-agent based on LotusScript. – Knut Herrmann Feb 08 '21 at 08:51
  • Thanks a lot Knut. It puts the goal so much closer now. When I use that line, I get a prompt if I want to send the document, save it, cancel, etc. Is there any simple way to put a code that removes that prompt and just sends the mail? – Adrian Feb 08 '21 at 09:51
  • Not simple, but possible: add this line `@PostedCommand([ToolsRunMacro]; "sendmymail")` instead and create a formula agent "sendmymail" in users' email nsf: `MEMO_SEND:="1024"; FIELD ActionInProgress:=MEMO_SEND; @If(@Command([FileSave]);@Command([FileCloseWindow]);@Return("")); @All` – Knut Herrmann Feb 08 '21 at 10:36