Problem with Agent and mail! (SOLVED)

HiI use this script in one of my agents. it’s work perfect but the problem is that if i use sender (se below)a get NO name in from? but if i use a Groupname a get it, any suggestion why?:

Set docMail = thisDb.createdocument

	docMail.Form = "Memo"

	sender="mail@sendto.com"

	docMail.from=sender

	docMail.SendTo = "mailtwo@sendto.com"		

	docMail.SMTPOriginator=sender

	docMail.Principal=sender	

	docMail.Subject = "New document!"

	' generate mail body

	Set rtItemA = docFROM.getfirstitem("Body")		

	bodytext = rtItemA.GetFormattedText( True , 0 )

	Set rtitemB = docMail.CreateRichTextItem("Body")

	Call rtItemB.AppendText(Chr$(13))

	Call rtItemB.AppendText("Kund: ")

	Call rtItemB.AppendText(Chr$(13))

	Call rtItemB.AppendText(docFROM.Company(0))

	Call rtItemB.AppendText(Chr$(13))	

… more script here!

Subject: Problem with Agent and mail! (SOLVED)

Just guessing. sendto is a reserved term in Notes. Maybe that’s causing strange behaviour? try using a different company name and see what happens.

Subject: Problem with Agent and mail! (SOLVED)

I know you solved it, but in case anyone else has the same problem:

docMail.from=sender should not be used.

If you need to set from refer to Agent FAQ that has a list of various methods of setting the mail sender.