Author |
Topic: Sending automated mail (Read 1606 times) |
|
acexbe
New Member
member is offline


Posts: 10
|
 |
Re: Sending automated mail
« Reply #3 on: May 6th, 2010, 5:00pm » |
|
As promised, the further developments...
Tried other mailclients and none of them work. Only outlook does the job. Maybe the mailserver is looking for specific data connected to the outlook client for preventing other mail methods? Can the mailserver identify the mailclient program?
So I am stuck with outlook. Starting Outlook with the correct messages in place is easy, but for sending the message, one has to push the send button or do a ALT-s from the keyboard. This is easy to do with:
SYS "keybd_event",&12,0,0,0 SYS "keybd_event",83,0,0,0 SYS "keybd_event",83,0,2,0 SYS "keybd_event",&12,0,2,0
The outlook application has to got the focus for this to work.
Regards, Manuel
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Sending automated mail
« Reply #4 on: May 7th, 2010, 4:32pm » |
|
on May 6th, 2010, 5:00pm, acexbe wrote:| Tried other mailclients and none of them work. Only outlook does the job. |
|
Personally I'd have nothing to do with any email service that worked only with Outlook (I use Eudora). They don't deserve your programming efforts, nor your custom.
Richard.
|
|
Logged
|
|
|
|
acexbe
New Member
member is offline


Posts: 10
|
 |
Re: Sending automated mail
« Reply #5 on: May 8th, 2010, 12:07pm » |
|
I totally agree with your remarks, the thought that microsoft rules all by excluding others is not pleasant. But as the mailserver in question only works with outlook, I have no choice. The only thing to try is fooling the server into believing the mail came from a outlook client, but this task lies outside my capabilities. The only drawback in using the ShellExecute method is that the email client application opens up for a brief moment, and this is far from elegant, but I can live with it.
Manuel.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Sending automated mail
« Reply #6 on: May 8th, 2010, 4:26pm » |
|
on May 8th, 2010, 12:07pm, acexbe wrote:| The only drawback in using the ShellExecute method is that the email client application opens up for a brief moment, and this is far from elegant, but I can live with it. |
|
You could try opening it with the window minimized (set the nShowCmd parameter of ShellExecute to SW_SHOWMINIMIZED) or even hidden (SW_HIDE). Since it won't then have input focus you will need to replace your 'faked' keyboard input with proper Windows command messages, but that is safer and more elegant anyway. You'll need Outlook's window handle for that, which you can probably get using FindWindow, and some detective work to find the right menu IDs!
Richard.
|
|
Logged
|
|
|
|
|