Clickable format to email links in lotus notes

2019-08-31 14:30发布

I am working on an application with xpages.I would like to send emails with that contain links. When I send the link, it does not appear in clickable format.Can someone help me to have clickable format? Thank you

   var db = session.getCurrentDatabase();
   var memo = db.createDocument();
   memo.appendItemValue("Body","http://www.my_link.com");
   memo.appendItemValue("Form", "Memo");
   memo.appendItemValue("Subject", "New task !");
   var t = mail.getValue();
   memo.send(t);

2条回答
小情绪 Triste *
2楼-- · 2019-08-31 14:45

If you are hoping that the statement memo.appendItemValue("Body","http://www.my_link.com"); will create a rich text field with link then it won't. For that use NotesRichTextItem class. You could also look into this Technote on how to create HTML formatted mail messages.

One question here, where will the recipient would be viewing this mail? In Notes client or this mail would be sent to IDs like Gmail or Yahoo? If recipient would be viewing this mail in Lotus Notes then you would have to enable this setting in your Notes client.

Go to File > Preferences > Basic Notes Client Configuration. Under the section Additional options enable the setting Make Internet URLs (http://.......) into Hotspots.

If the mail is being sent to IDs like Gmail or Yahoo then you would be at their mercy on how links are displayed. But in my experience they always display links, if they are in valid format.

查看更多
Bombasti
3楼-- · 2019-08-31 14:58

If you do it like this, the "Body"- Item is a simple Text- Item and not a Richtext- Item. Text- Items cannot contain clickable links.

You have to explicitly define Body as a NotesRichtextItem and append text to it:

var rtitem:NotesRichTextItem = memo.createRichTextItem("Body");
rtitem.appendText("http://www.my_link.com");
rtitem.addNewLine();

This way the link will automatically be converted to a clickable hotspot.

查看更多
登录 后发表回答