Solved

Sending mail to lotus notes server

Posted on 2004-04-22
9
2,120 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
  • 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now