Link to home
Avatar of pernicek
pernicekFlag for Czechia

asked on

Lotus Notes vs VBA offline e-mail sending

Hi @ all,

I'm developing solution for my wordwide partner from switzerland. It sending e-mail from word, excel via Lotus Notes Automation classes, VB for applications.Everything works well, but we cannot send e-mails offline.

We are using mail.box file of user and the document.save method. It appears good, we can see the mail in items to sent via Lotus Notes GUI, but when user synchronize, it shows general error with no other description. I have attached source code.

I have attached module LotusNotes.bas, which is actually used for sending mails. There are used some function from other modules, such as recipient detection & else, which are not directly participating on described error.

I can send whole (.docx) file if required.
ASKER CERTIFIED SOLUTION
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
tip: send a memo from the user, and check which other field need to be set. I am guessing that the replicator does not like mail without a sender name.

You can get more information on the fields you find in the example mail.  This webiste describes Calendaring and scheduling which is an extension of the Mail functionality.  So it contains a little too much info, but will help you along deciding what to put in the fields you do find in your own example mail.

Also, it would be helpful if you included the error message you are receiving.
Avatar of pernicek

ASKER

At dragon-it,

as you can see in attached bas file, we are using the same way to connect database.

In first version (attached is third) we had the same way as you, to send mail both online and offline.

But when you were offline, an error was occured: database object was empty, so we decided to change way and store mails directly to mail.box file, but lotus not send them when synchronize.

That's the point of problem.

At larsberntrop: Thanks for tip, we believe, that we are missing some items (like senders name) in offliíne version. I will try you solution and let you know.
Ok, the part I looked at you were getting the mail server and name from the notes.ini file?  This used OpenMail which for me works regardless of offline or not when the user had local mail file but maybe not in your environment?

Steve
Only some users have local replica, but i feel (tested by other person) that this results in described exception.
If you don't have a local replica, mail replication usually is inactive.
Thanks for selecting my answer, though not for the "B" grade, I hasn't seen the last few comments there at the time.

Frankly if there mail clients are setup with locations that the user uses such as the default just "Island" and "Office" pointing to a server mail file then there is no local mail facility.  There may be a mail.box or local mail replica but that is irrelevant as nothing specifically does anything with them.

If they have been defined with an "offline mail" and "online mail" location or similar aswell and local sceduled replication is turned on then yes dropping a mail in mail.box while in offline state should send as soon as they replicate or it is scheduled to run.

So mainly it is down to how the client is configured, but using notesdb.openmail rather than reading notes.ini should work.  If they are truly offline and no local replica / replication then I would suggest storing a transaction in your applications perhaps which could be retried later.

Better though would be to configure the notes clients with local replicas if they are expected to work offline.

Steve