質問

Names is not getting resolved while using HTML mail in xpages. Is it a problem with the snippet i took from xsnippet or problem with mime itself.

import ss_html_mail;

var mail = new HTMLMail();
var res:java.util.Vector = new java.util.Vector();
res.add("Soundararajan, Thirun");
res.add("Arumugam, Barath");
res.add("Selvam, Abirami")
res.add("Panneerselvam, Saravanan")
mail.setTo(res);
mail.setSubject("HTML Mail");
mail.addHTML("HTML Mail");
mail.send();

However if replace those names with email address or use default SSJS send function it is working. Default send() function resolves the names to email properly

res.add("Soundararajan.Thirun@gmail.com");
res.add("Arumugam.Barath@gmail.com");
res.add("Selvam.Abirami@gmail.com")
res.add("Panneerselvam.Saravanan@gmail.com")

or

var doc = database.createDocument();
var res:java.util.Vector = new java.util.Vector();
res.add("Soundararajan, Thirun");
res.add("Arumugam, Barath");
res.add("Selvam, Abirami")
res.add("Panneerselvam, Saravanan")
doc.replaceItemValue("Form", "Memo");
doc.replaceItemValue("Subject", "An email");
doc.replaceItemValue("SendTo", res);
doc.send();
役に立ちましたか?

解決

I use this xsnippet all the time and the problem in your code is that you are using an vector to add the names in. Try to add the names in a Javascript array instead. Like this

import ss_html_mail;

var mail = new HTMLMail();
var res=[]
res.push("Soundararajan, Thirun");
res.push("Arumugam, Barath");
res.push("Selvam, Abirami")
res.push("Panneerselvam, Saravanan")
mail.setTo(res);
mail.setSubject("HTML Mail");
mail.addHTML("HTML Mail");
mail.send();
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top