I am trying to send the emails from my XPage, to external email ID (my personal email ID), but getting error while executing the code.
I am running the XPage application on my local domino server. I haven't changed any configuration settings to enable emails/smtp as I am not aware of how to make these changes. This is the local server, and in my XPage application, my requirement is to send emails to personal email id rather than lotus notes mail box. I the server, I haven't configured mail databases for any user.
I tried following ways to send the mail, but nothing worked:
//Approach 1, simply mention from and to as external email addresses
var docMail : NotesDocument = database.createDocument();
docMail.replaceItemValue("Form","memo";
docMail.replaceItemValue("From","abc@gmail.com";//assume this is actual mail id
docMail.replaceItemValue("SendTo","def@gmail.com";//assume this is actual mail id
docMail.replaceItemValue("Subject","Test mail";//assume this is actual mail id
docMail.send();
//Approach 2, suppose I am logged in as test user1/Dev
//Configured forwarding address for test user1 and test user2 as abc@gmail.com and def@gmail.com respectively.
var docMail : NotesDocument = database.createDocument();
docMail.replaceItemValue("Form","memo";
docMail.replaceItemValue("SendTo","CN=Test User2/O=Dev";//assume this is actual mail id
docMail.replaceItemValue("Subject","Test mail";//assume this is actual mail id
docMail.send();
Here, docMail.send() is throwing some SMTP error, saying something like destination mail system is unreachable.
After following the instructions given in tech-notes (see the link in below comments), now docMail.send() is throwing error, and the console shows the error message: 'Development/Home is not a known TCP/IP host' (assume Development/Home is my local development server).