1

I would like to also change the field "sent by" (displaying when there is a mailDoc.Principal) in the mail being sent by a triggered agent created in lotus script. Is it possible to change it I already tried the following codes

mailDoc.SentBy = strFrom
mailDoc.tmpDisplaySentBy = strFrom
mailDoc.FROM = strFrom
mailDoc.SendFrom = strFrom

Still I couldn't change that part.. Is it possible or is there some limitation?.. Thanks

1 Answers1

7

You can't change it. The server puts always the current username into field Principal/From.

But there is a workaround: instead of sending the mail save the mail document into mail.box on server with a Principal/From field content of your choice. This way server won't change the field anymore.

Here is an example from Karl-Henry Martinsson how to do it.

Knut Herrmann
  • 30,880
  • 4
  • 31
  • 67
  • Hi Knut, thanks for answering the question, but I have questions.. the principal field is working fine.. the one that is not working is the "Sent By" Field.. Regarding your suggestion, you mean I'll directly save it there in the mail.box of the server along with the field "Principal" and "Sent By" changed. I would prefer sending it directly.. is there any negative side in saving a docmail in mail.box? – Kevin Patrick Tan Feb 20 '14 at 07:27
  • 1
    This is the common and usual way to "manipulate" the SentBy field and I haven't heard about negative side effects yet. – Knut Herrmann Feb 20 '14 at 07:52
  • 1
    We used for many years an alternative solution adding "@NotesDomain" to Principal field. That works well for mails which leave company. If mail recipient is internal then answering mail doesn't work so well. Look here http://www.ibm.com/developerworks/lotus/library/ls-Troubleshooting_agents_ND5_6/ in section "How can I change the apparent sender of agent generated mail?" – Knut Herrmann Feb 20 '14 at 08:00
  • Hi Knut, thanks a lot for the information and help. It worked, but I would still use the sending mail directly. But your reference helped me a lot learned that the right field for "sent by" is "SMTPOriginator" thus it worked properly now.. I believe the codes you shared is used for scheduled agent since in scheduled agent that's what happen where the server uses the server as it's fields. Thanks a lot.. – Kevin Patrick Tan Feb 20 '14 at 08:21
  • 2
    The code is not only for svcheduled agents, it can be used in agents running on the client as well. A typical example would be if a user want/need to send out an email that looks like it is coming froma role account. Example: Jane Smith is using a Notes application to send out an email to selected customers, but it should look like the email is coming from accounting@example.com, not jsmith@example.com. – Karl-Henry Martinsson Feb 20 '14 at 15:40
  • Hi Karl, I see thanks for informing me sorry for the delayed reply since I was not able to open my stack overflow for some time. Thanks. I'll keep a note of this. – Kevin Patrick Tan Mar 20 '14 at 06:04