Solved

Sending mail to lotus notes server

Posted on 2004-04-22
9
2,171 Views
Last Modified: 2013-12-18
Hi All;
I am very new to lotus notes and I am trying to send a email through lotus notes server but I am getting the following exception:
"4271 Password or other security violation for database"

I have installed the Lotus Notes client on my m/c ver. 5.0.3. and I am trying to connect to remote server
Here is the Code that i using
----------------------------
import lotus.domino.*;

public class SendLotusMail extends AgentBase {    
public static void main(String args[]) {
          String userID = "uid";

          String pwd = "passwd";
          String serverName = "server_name";
          String mailfile = "mail_file";
          try {
               NotesThread.sinitThread();
               String x = null;
               Session session = NotesFactory.createSession(x, x, pwd);
               Database db = session.getDatabase(server_name, mailfile);
               Document email = db.createDocument();
               email.appendItemValue("From","the junk address");              
               email.appendItemValue("Subject", "Test Secure E-Mail ");
               email.appendItemValue("ReturnReceipt", "1");
               //add attatchment
               RichTextItem rtitem = email.createRichTextItem("Body");
               rtitem.embedObject(
                    EmbeddedObject.EMBED_ATTACHMENT,
                    null,
                    "C:\\Windows\\15658.pdf",
                    "15658");

               email.setSignOnSend(true);
               email.sign();
               email.send(true,"recepient mail address ");
          } catch (NotesException e) {              
               
               System.out.println("Exception--->" + e.id + " " + e.text);
          }

     }
}
0
Comment
Question by:arun2702
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
9 Comments
 
LVL 19

Accepted Solution

by:
RanjeetRain earned 39 total points
ID: 10888721
try changing this line
        Session session = NotesFactory.createSession(x, x, pwd);
to
        Session session = NotesFactory.createSession(serverName, userID, pwd);





0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10888910
Hi arun2702,
>      NotesThread.sinitThread();
>                String x = null;
>                Session session = NotesFactory.createSession(x, x, pwd);


Limit your initial try block to those three statements, then try successive statments in their own try blocks, so you can diagnose which statment is giving an access violation.  You might also try recording session.getEffectiveUserName() to see if your login ID is what you expect, then use the Notes client with the ID file that matches that login to do the equivalent operations...

    - create a memo
    - set subject text
    - set the return receipt option, signature
    - embed a file in the message body
    - send

Note that you should have a replaceItemValue("Form","Memo")... and that replaceItemValue is much preferable to appendItemValue.

Cheers!
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10888915
Good catch Ranjeet!  I didn't even notice that he weirded out that call.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10889221
Thanks Qwaletee!
0
 

Author Comment

by:arun2702
ID: 10906921
Thanks a ton for ur replies , after modifying the code for Form
I am getting following error:
"Configuration setting for Server either missing or Invalid"

can u help me solve it.......
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10918320
Check your server document. Or it may be due to corruption???
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10923316
You would only get that if a Domino server tried to start up, and teh ID it started up with did not have a server settings document in the directory.  Now, perhaps you are trying to do something on your workstation that makes Domino think you are trying to run a server process?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question