Link to home
Start Free TrialLog in
Avatar of spuppis
spuppis

asked on

delphi 7, silent sending mail, MAPI

I'd like to send "silent" email in delphi 7 using MAPI, just without Outlook dialogs displaying every time i send an email.
I have working code just can't figure out how to disable dialogs, wandering if changing this line could help:
Result := SM(0, Application.Handle, msg, MAPI_DIALOG or MAPI_LOGON_UI, 0);
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

I don't think it is possible, and however I'm sure it would not be politically correct nor legal send email without inform your user about. Are you sure to want to do it?
Avatar of Mike McCracken
Mike McCracken

I know we were able to do it several years ago but it did require a mod to the MS Exchange server.  

MS in an attempt to help prevent malware from spamming people added a flag in Exchange that when set requires the prompt to the user before an EMail goes out.

If you can be certain that malicious code can't get onto your system or that you would detect it quickly than you might be able to reset the FLAG to 0

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of Sinisa Vuk
Sinisa Vuk
Flag of Croatia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I developed a small component to implement log files sending in my applications: this component post log files to my web server where a php script sends files as email attachments to my mail box. The component is free with source: maybe you can find it interesting, depending on what is your goal here. http://www.delphicoding.com/mgeasylog.php

Cheers
Try it as follows...
Result := SM(0, Application.Handle, msg, 0, 0);

Open in new window


Some helpful links:
Sending an email from Delphi using MAPI
How to send email using the MAPI
If you now get a security warning from Outlook, you have 2 options to prevent this warning:

1.)
Disable warning in Outlook security center (line of action depends on your Outlook version)

2.)
If you are in a network and a network administrator controls the group policies, then you should ask your network administrator to add your program to the list of trusted programs, for which warning is not displayed...
Avatar of spuppis

ASKER

ICS works perfectly, it helped me find also the correct version of dlls which is 0.9.8h - Indy found at: http://indy.fulgan.com/SSL/Archive/