Solved

Sending mail to lotus notes server

Posted on 2004-04-22
9
2,139 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA Lotus notes 2 198
Lotus notes email code 13 94
Lotus Notes Calendar Issue 5 112
Scan to Email - HP 477 Printer and Lotus Notes 8 78
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

831 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