VIEW MEMBER FEEDACK TO THIS TIP
There are times when employees need to forward company e-mails to a home/other account. The standard Notes "Send Mail Message" with "Include copy of document" does not make it easy to determine the original sender and subject. This bit of code lets you "forward" to another e-mail account while retaining the original Subject and From fields. The agent can be set to run Before New Mail Arrives.
MEMBER FEEDBACK TO THIS TIP
This is a nice tip and a nice idea. However, on my site (Notes 5.09a) it works only properly for Notes-Mail.
For SMTP-mail I get the message "Notes Error: Encryption key not found (mail database is not encrypted on the server)."
On the server console I get the message
"> 25.05.2005 10:27:00 AMgr: Agent ('Mail2Home' in 'mail\kossi.nsf') Fehlermeldung (Error Message): Object variable not set"
Any ideas?
Michael K.
******************************************
The Rules feature of Notes can also be customized to forward e-mails to another account [particularly useful for those without Designer access], as follows:
Go to Tools, Mail Rules and choose New Rule.
Under Specify Conditions, create Condition When: Sender does not contain!.
Click Add to put condition into the window When mail messages arrive that meet these conditions:
Under Specify Actions, specify "send copy to" "full," with user's forwarding address in the To: field.
Click "Add Action" to put 'send full copy to [username@domain.dom]' action into 'Perform the following actions:' window.
Click OK.
Enable or Disable the rule as needed by choosing the appropriate button.
Mira B.
******************************************
This tip did not work in our setup (Domino 5.0.13, clients in 5.0.11), so I altered it and it works like a charm for us. I added to the doc.pr
To continue reading for free, register below or login
To read more you must become a member of SearchDomino.com
');
// -->

incipal, doc.inetfrom and doc.replyto fields. Here's the code:
Robert B.
******************************************
I have encountered problems with using a forwarding agent and before mail arrives execution. If there is a high volume of mail it only processes 70% of the mails. I would suggest having it run as a scheduled agent and set a processed flag on the document to know what has been processed. I have had much better luck with this method.
Pablo H.
******************************************
I suspected this was probably the solution you'd come up with, based on the abstract. A minor suggestion, however, having implemented virtually the same code myself.
Somewhere after the CopyAllItems you want to remove whatever may have been in the incoming CopyTo field. Otherwise, if you were copied on the original message, you will send a new copy to yourself (and any others copied), and the cycle will continue....
John D.
******************************************
I can't get this to work with mail coming in from outside e-mail addresses. My Domino server reports, "Notes Error: The cryptographic key was not found." Does it only work for incoming Domino mail?
Jeffery H.
******************************************
The short, quick answer is that it works for us on all e-mail. Whether it comes from another Domino user, Hotmail, Yahoo, etc., it doesn't make any difference in our shop.
The message regarding "cryptographic key" sounds like you have an option in your mail formatting that is different from what we're doing here. I've never encountered any error or warning message involving cryptographic keys. This option worked for us in R5 and R6. I'd be curious to know what you're using.
The next thing I'd check would be whether or not the e-mails were encrypted, or if your company encrypts incoming e-mails. We don't encrypt e-mails as a rule in our shop, so I've never tested the performance using encrypted e-mails.
Wade Gilliland, tip author
******************************************
Changing the line code
to
should cure the "Notes Error: The cryptographic key was not found." problem.
Moreover the document needs to be saved before sending otherwise the recipients specified in the SendTo item are not picked up.
Something like:-
Or even better the recipients can be specified directly in:-
Stefano D.
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Wade Gilliland. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.