Mail from lotusscript

I use lotusscript (invoked from an agent that is started via a webbrowser) to generate a mail message. I can define SendTo, Subject, Body etc., but how to control the From field?

Now it has the format first_lastname%server@domain.nl.

Does any one knows where this name comes from? And how to change it?

TIA

Subject: Mail from lotusscript

You can put whatever you want in the From field. If you don’t explicitly define it, it will most likely pick up the server name that the agent is running on.

Subject: RE: Mail from lotusscript

Dear Esther,

Thanks for your suggestion, but I defined the field “From” with a (valid) string, and the receiver of the message still gets that “default” sender and not the string I entered.

Any other suggestions?

TIA

Subject: RE: Mail from lotusscript

Post your code…

Subject: RE: Mail from lotusscript

Hi Esther,

This is the code I use (please note that doc and db are correctly assigned)

Dim memo As NotesDocument

Dim rtitem As NotesRichTextItem

Set memo = New NotesDocument(db)

memo.Form = “Memo”

memo.From = “info@mydomain.nl”

memo.SendTo = doc.EmailAddress(0)

memo.Subject = “Test”

Set rtitem = New NotesRichTextItem(memo, “Body”)

Call rtitem.AppendText(“Dummy text”)

Call memo.Send(False)

Regards

Rob

Subject: RE: Mail from lotusscript

a qnd :

set db = server , mail.box

and then

call memo.save(True,False)

Subject: RE: Mail from lotusscript

Hi Peter,

I did what you suggested, but there is no difference.

I created a new user with the name: info. Now I create and send the memo in that mailbox. It shows up in that mailbox in the send folder, but in the from-field the name is not “info”

Subject: Mail from lotusscript: the solution!

I found the solution (here in the forum and with some testing!):

When you want to support both Notes-mail and Web-mail you have to fill in the following MIME-headers:

Set memodoc = maildb.CreateDocument

Set memo = memodoc.CreateMIMEEntity

Set header = memo.CreateHeader(“From”)

Call header.SetHeaderVal(“The Acme”)

Set header = memo.CreateHeader(“Reply-To”)

Call header.SetHeaderVal(“info@acme.com”)

Set header = memo.CreateHeader(“INetFrom”)

Call header.SetHeaderVal(“The Acme info@acme.com”)

Now both types of receivers will see an acceptable header of the message.