A really basic email lotusscript issue

This code does what so many people do – sends an email with the alternate name set in the Principal field. But the problem is – it works within the Notes environment, but external emails display [BLANK] where there should be the sender name. That’s the problem. (I’ve been beating my head against the wall too long on t his one.)

Set doc = ui.Document

Call doc.ReplaceItemValue( “Principal”, doc.FromField(0) )

Call doc.ReplaceItemValue( “INetFrom”, doc.FromField(0) )

Call doc.ReplaceItemValue( “INetReplyTo”, doc.FromField(0) )

Call doc.ReplaceItemValue( “ReplyTo”, doc.FromField(0) )

Call doc.ReplaceItemValue( “From”, doc.FromField(0) )

Set ni = doc.GetFirstItem( “SendTo” )

Call doc.ReplaceItemValue( “INetSendTo”, ni.Values )

Call doc.ReplaceItemValue( “$StorageTo”, ni.Values )

Set ni = doc.GetFirstItem( “CopyTo” )

Call doc.ReplaceItemValue( “INetCopyTo”, ni.Values )

Call doc.ReplaceItemValue( “$Storagecc”, ni.Values )

Set ni = doc.GetFirstItem( “BlindCopyTo” )

Call doc.ReplaceItemValue( “INetBlindCopyTo”, ni.Values )

Call doc.ReplaceItemValue( “$Storagebcc”, ni.Values )

doc.Send( False )

Subject: Use a different instace for the mail document

I’d start with using another instance for the mail document, not the doc. instance itself. Maybe there are some fields in your UI you forgot about which cause the problem?

Subject: That didn’t work

No change

Subject: Maybe this post gives you a direction to look into

http://www-10.lotus.com/ldd/nd8forum.nsf/DateAllThreadedWeb/091260a687967ce48525766b00073a28?OpenDocument

Subject: Resolved

I employed a class library that was snagged, iirc, from the Sandbox. Works much better than my code. Thanks, all.

Subject: What are the values?

Would be useful to know the value of doc.fromfield(0)

When I’ve done this before I’ve always set the principal to the standard notes name, but set the inetfrom field to their full email address.