I use Lotus notes to send emails in my ASP.NET and C# web application. It sends emails when its in debug mode however if I publish in my local IIS server it does not send any emails.
Domino.NotesSession oNotesSession = null; ;
Domino.NotesDatabase oNotesDatabase = null;
Domino.NotesDocument oNotesDocument = null;
Domino.NotesDocument oNotesDocumentForOther = null;
object oItemValue = null;
bool flag = false;
try
{
String UserName = "";
try
{
oNotesSession = new Domino.NotesSession();
}
}
I get below error in the above line
{System.OutOfMemoryException: Retrieving the COM class factory for
component with CLSID {29131539-2EED-1069-BF5D-00DD011186B7} failed due
to the following error: 8007000e.
It sounds like the Lotus Notes COM DLLs or notes.ini file are not available to the account under which IIS is running. Can you change your IIS app pool to run under your account (the same account you use to access Lotus Notes?)
Alternatively, if you're just sending emails, is there any chance you can take the Lotus Notes client out of the picture entirely and just send via SMTP to the Lotus Notes server (or any other SMTP server in your domain?)
Ken is almost certainly correct, however there's another thing to consider. If you are intending to deploy your ASP project on a 64 bit server, you should be aware that the Domino Interop COM classes are not available as 64 bit code and the 32 bit version is not supported by IBM on Win64. It is possible to make it work for some purposes by installing Domino and manually registering the DLL for the classes, but there are known problems with some of the methods in the classes, and IBM is not planning on fixing them.
So I agree that you would be much better off writing your code to send SMTP messages.
Related
Trying to add an event to Outlook calendar through my event registration app using asp.net/C#. Getting call was rejected by callee error when trying to initialize (line 1). How do I overcome this issue?
Error:
"Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80010001 Call was rejected by callee. (Exception from HRESULT: 0x80010001 (RPC_E_CALL_REJECTED))."
Outlook.Application outlookapp = new Outlook.Application();
Outlook.AppointmentItem appt = outlookapp.CreateItem(Outlook.OlItemType.olAppointmentItem) as Outlook.AppointmentItem;
appt.Subject = er.Event.Name;
appt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting;
appt.Location = er.Event.LocationName;
appt.Start = er.Event.StartTime;
appt.End = er.Event.EndTime;
appt.Recipients.ResolveAll();
appt.Display(false);
appt.Save();
Firstly, you cannot use Outlook from a service (such as IIS).
Secondly, even if your code worked, you'd end up creating an appointment and displaying (!) it locally on the server machine, where there isn't anybody to see it.
Create an iCal file and provide a link to the user - the ics file will be opened on the client machine using Outlook and the user will be able to save it.
Server-side Automation of Office is not supported
Developers can use Automation in Microsoft Office to build custom solutions that use the capabilities and the features that are built into the Office product. Although such programmatic development can be implemented on a client system with relative ease, a number of complications can occur if Automation takes place from server-side code such as Microsoft Active Server Pages (ASP), ASP.NET, DCOM, or a Windows NT service.
See : https://support.microsoft.com/en-ca/kb/257757
I'm currently working with the MQ .NET assemblies and am attempting to read queue depths of various queues for a monitoring application. We have the code working in Java, but our new application is in C# and it would be preferable to keep all this logic in the same application.
From what I've heard online, .NET assemblies ignore MQC.USER_ID_PROPERTY and instead use the user ID of whoever is running the application. Is there really no way to override this? This seems a very strange feature/bug. I know that MQC.TRANSPORT_PROPERTY is supposed to influence how the UserID is inferred, but whether I set to MQC.TRANSPORT_MQSERIES_MANAGED or MQC.TRANSPORT_MQSERIES_CLIENT, I see the same ID going up in Wireshark and get the same error back (MQRC_NOT_AUTHORIZED). Has anyone else found a workaround for this fairly large issue?
properties = new Hashtable();
properties.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
properties.Add(MQC.HOST_NAME_PROPERTY, hostName);
properties.Add(MQC.PORT_PROPERTY, port);
properties.Add(MQC.CHANNEL_PROPERTY, channelName);
properties.Add(MQC.USER_ID_PROPERTY, userId);
properties.Add(MQC.PASSWORD_PROPERTY, "");
// create connection
queueManager = new MQQueueManager(queueManagerName, properties);
If you are using MQ .NET client (or for that matter MQ C client also) version prior to v8, the user id set by the application is not sent to the queue manager. Instead logged in user id is passed to queue manager for authentication. This is a known behavior of MQ versions prior v8.
You can develop and use what is known as security exit to perform user authentication. A security exit performs username and password authentication against a repository, such as the local operating system on the MQ server, or an LDAP repository.
You can also use SSL/TLS if that's suitable to you. Otherwise you can move up to use MQ v8 to make use of the out of the box user id/password authentication.
I'm trying to send an email using a Domino server from C#/VB.NET. (Having Lotus Notes client 8.5.3FP6)
The code looks like
using Domino;
...
try
{
NotesSession ns = new NotesSession();
NotesDatabase db = default(NotesDatabase);
NotesDocument doc = default(NotesDocument);
if (ns != null)
{
ns.Initialize(password); // Crashes here
...
I've looked at several example like
http://www.ibm.com/developerworks/lotus/library/domino-msnet/
http://www.codeproject.com/Articles/29442/Send-Lotus-Notes-Email-Using-C
http://www.codeproject.com/Tips/628681/Sending-mail-from-LotusNotes-using-Csharp
Lotus Notes Sending email with options
but they all crash in the Initialize call, without coming to the catch statement so I can see any error message.
What can be wrong? I have tried InitializeUsingNotesUserName as well as not sending in the password to Initialize, with same results.
I've also tried to import the reference to Domino if there was any problem with the interop file.
Thanks!
Try the following setting and see if it helps, can be found in File -> Security - User Security in Notes client
Not sure what your "DB" where you try to create a mail, but when I try to send a mail directly via Lotus Notes I use a selfmade function which directly create the mail into the server based mail.box
The reason why I do that is, that I have seen issues, when multiple users shared the same PC (and where they have only read access to the names.nsf or a local mail.box). I never saw that a client crash, but the issue with missing rights often caused similar error messages (Please not that IBM didn´t really support using the same profile for multiple users, so this is more the users fault because they didn´t the time it takes to relogin via windows). Since using the mail.box I haven´t seen such issues.
I had crashes when calling 'new NotesSession()', and solved it by registering nlsxbe.dll (run as administrator):
> regsvr32 "c:\program files(x86)\ibm\notes\nlsxbe.dll"
I'm currently working on a .NET application that will be invoked from Lotus Notes 8.5. This .NET application is suppose to read some data from a Lotus Notes database, and export it to a file.
The code to connect to the Lotus Notes database is:
NotesSession ns = new NotesSession();
NotesView nv;
ns.Initialize("");
NotesDatabase nd = ns.GetDatabase("server", "file.nsf", false);
nv = nd.GetView("viewName");
Unfortunately, when ns.Initialize is invoked, the Lotus Notes component will prompt the user for their password. I understand that the method Initialize is overloaded, the user name and password can be provided. However, I will not know the username / password.
Since Lotus Notes will be open already, is there a way to access the Notes Database using the credentials of the user that is already logged into Lotus Notes? Essentially, I'd like to avoid having the user enter their Notes credentials again, but still access the database.
There is a setting that can be turned on in Notes in the User Security dialog. (You didn't mention the version of Lotus Notes. The dialog may be different if you're on an older version.) The setting is:
Don't prompt for a password from other Lotus Notes-based programs (reduces security).
Those last two words may be in parenthesis, but don't let that fool you. They are pretty important! The setting allows all programs running on that user's computer to use the Notes APIs without authentication. That opens the door for an email-borne piece of malware, amongst other threats. And never mind the fact that such threats have been rare in the Lotus Notes world. A big part of the reason for that is that keeping this setting disabled is the default.
From what I've said above, I'm sure you can understand why there isn't an easy way to do what you want to do!
The only way to disable the password prompt specifically for your application will be to use the Lotus Notes C API's feature set known as Extension Manager. I.e., you write a C source file that is compiled into a DLL. Your DLL must be installed on all users' machines, and an entry must be made in the notes.ini file in order to have it loaded when the Notes core DLLs run. The help files for the C API include some sample code showing how to do the Notes-specific part of this. You'd have to figure out the details of identifying the fact that it was invoked for your application, and (if I remember correctly) you would also have to write code to prompt the user for their password once and be responsible for securely storing it somewhere where your DLL can retrieve and decrypt it whenever it needs it.
I did find another way to perform this, without having to turn the "Don't prompt for a password from other Lotus Notes-based programs (reduces security)." check box on.
System.Type objNotesType = System.Type.GetTypeFromProgID("Notes.NotesSession");
dynamic ns = System.Activator.CreateInstance(objNotesType);
dynamic nd = ns.GetDatabase(AppSettings.NotesServer, AppSettings.NotesReplicaID);
if (nd.IsOpen != true) nd.OpenByReplicaID(nd.Server, AppSettings.NotesReplicaID);
dynamic nv = nd.GetView(AppSettings.NotesView);
I've tested it, and it works. I am not prompted for a password, and when accessing the Notes Database, I am accessing it under the current user's credentials. Also, no COM references needed to be added to the project.
I am working on integrating my company's product with Jira so users can log bug reports directly from the application. Everything was wqorking smoothly so i decided to import the data from our live Jira system into my development system so that i had some real world data to play with. Since then when i try to get an authtication token it throws the following exception "com.atlassian.crowd.exception.PasswordEncoderNotFoundException: The PasswordEncoder 'atlassian-security' was not found in the Internal Encoders list by the PasswordEncoderFactory". I have checked and the Atlassian Security Password Encoder is enabled in the Crown Password Encoders plugin.
My code is super simple just an ASP.net based text based issues search with the results wired to a grid view code as below:
JiraSoapServiceService service = new JiraSoapServiceService();
string token = service.login("integration", "test");
if (!string.IsNullOrEmpty(txtSearch.Text))
{
RemoteIssue[] issues = service.getIssuesFromTextSearchWithLimit(token, txtSearch.Text, 0, 100);
gvwIssues.DataSource = issues;
gvwIssues.DataBind();
}
I get the error on the call to service.login, it worked fine before I imported the live data. And yes i did add the integration user again after i had imported the data.
Anyone any ideas on this.
No idea what was causing this but rebooting the PC that the dev Jira was installed on fixed it.
EDIT
I have had this a few times now. It tends to happen when you do something like restart the SQL server, restore the jira database via SQL server, restore jira via the inbuilt XML file import method or similar. You don't have to restart the machine just the jira windows service. No idea if this is a problem with other DBs or server types.