Hello all out there.
I’m facing a little problem I can’t resolve and I’ve not found the solution to my specific little problem in this forum. The scenario is:
I have an application that includes a small mail-like form with typical mail fields like SendTo, Body, Subject, etc. The idea is that users could send mail using that form in the application using an action in the form that triggers an agent. The mail form have a Sender field where users can type in an e-mail address so it appears that the mail have been sent from that e-mail address. All works fine, but I have a problem with the From field. When an e-mail sent that way arrives to the intended destination, it always shows “Sent by USER”. As I have seen, the From field populates with the hierarchical name of the Notes user that sends the e-mail, ignoring the code in the Agent. Can I avoid that? or the problem is that the agent is executed by an action and so the From field always is written with the user name when performing the Doc.Send method?
I’ve read a lot of help documentation about this, also I’ve read the threads related to this in this forum, including these references:
Thanks in advance
- Agent Code -
Set MailDoc = New NotesDocument(BD)
With MailDoc
.Form = "Memo"
.SendTo = SendTo
.Principal = Sender & "@Dominio"
.INetFrom = Sender
.INetPrincipal = Sender
.ReplyTo = Sender
.Recipients = SendTo
.PostedDate = Now
.Subject = Subject
.DeliveryPriority = "L"
End With
Call MailDoc.Send(False)
- End Code -
Where:
-
Subject is a String containing the message subject
-
SendTo is a String containing an e-mail address (ex: user@acme.com)
-
Sender is a String containing an e-mail address (ex: orguser@orgdomain.com)
-
“Dominio” is the notes domain name (so “@Dominio” is added in the Principal field)