BBC BASIC for Windows
Programming >> Communication and Input/Output >> Sending automated mail http://bb4w.conforums.com/index.cgi?board=communication&action=display&num=1270752746 Sending automated mail
Post by acexbe on Apr 8th, 2010, 6:52pm
Using the ShellExecute-API works ok but you have still to push send. (as described) Next tryout is using the SMTP-method. The IP is known, but running the program gives no errors and no mail is received by the destinator.
Trying a telnet session to the SMTP-server does not work also, strange.
So is seems you have to pass trough the email client to get anything out.
Next tryout is using the SMTP-method. The IP is known, but running the program gives no errors and no mail is received by the destinator.
Did you enable the debug option in PROCsendmail? You do that by setting the global Boolean variable DEBUG% to TRUE. That should hopefully show you what is going wrong.
Quote:
But here the programmer uses the MAPI-control of VB6. Bummer
You can access MAPI from BBC BASIC if you need to. It's fundamentally no different from any other COM API.
To repeat what I've said so many times, BBC BASIC for Windows is a general purpose programming language for Microsoft Windows. With very few exceptions, anything you can do in an alternative language you can do in BBC BASIC.
Richard.
Re: Sending automated mail
Post by acexbe on Apr 9th, 2010, 6:32pm
Hello Richard, I did enable debug and received the following messages:
T: HELO xxx (name of pc) T: MAIL FROM: xxx (self-explanatory) T: DATA Mistake >Recv failed in module (path\SOCKLIB)
So the error message is coming from the lib.
I do get this behavior only on a local WAN mailserver. Tests at home via ISP are ok.
The strange thing is: when I ping to the WAN SMTP-server, I do get a reply (tested with name or ip)
With this I get no error, but again no mail is being received, also no log file is made.
When changing something like the ip, then a log is created. So outlook is for the moment the only way to send mail. Maybe it is some form of protection at the mailservers side? Tried again with telnet: telnet XX.XX.XX.XX 25 Result is a blank screen, no message. Pressing any character for sending a command results in a exit from telnet.
Re: Sending automated mail
Post by acexbe 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:
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. Re: Sending automated mail
Post by acexbe 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.
Re: Sending automated mail
Post by admin on May 8th, 2010, 4:26pm
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!