Email from Access - reply from outlook

quacka

Registered User.
Local time
Today, 08:31
Joined
May 16, 2007
Messages
16
I am busy with a database that mails a few documents via email.
No problems: The mails are sent inclusive a few attachments.
The solution is something proposed in this topic:
http://www.access-programmers.co.uk/forums/showthread.php?p=856186

Now my problem:
Is is possible to get a kind of reply from Outlook that the mail-send is completed succesfully?
Now it is possible to create the mail by pushing a button at a form. The mail is opened and if correct the user will send the email.
But if not correct then the user will cancel the email.

Access don't sees the difference between cancel of send... As soon as Access creates the email the instruction is complete. So I want to know if it really has been completed. (or cancelled..)
 
Is is possible to get a kind of reply from Outlook that the mail-send is completed succesfully?
In the example there is an object created named olNewMail. This is an Outlook mailitem object which you can find in the object browser for all the properties and methods it has.

After it is sent then
Code:
olNewMail.sent
should be true

Now it is possible to create the mail by pushing a button at a form. The mail is opened and if correct the user will send the email.
I would not suggest you actually send the email from Access as there are security measures which are really hard to get around when a program other than Outlook tries to send emails. I would suggest you do everything other than send, then display the message for the user to send. Of course you can send from access but the user gets a message that they can only click after I think 10 seonds.

Access don't sees the difference between cancel of send... As soon as Access creates the email the instruction is complete. So I want to know if it really has been completed. (or cancelled..)
See what I have said above. One thing I am not sure of is if you keep the object after it is sent. If not then you might have to get the mail item as an object again. A mail item has a EntryID - you might be able to get this/or make this before you send it, then after it is sent get the mail object again by finding this ID.
 

Users who are viewing this thread

Back
Top Bottom