Announcement

Collapse
No announcement yet.

MAPI mail question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Daniel C Fischer
    replied
    BLAT is open source and it works.

    See the website for more: http://www.blat.net/

    I use "BLAT" running on W2k and above to send email from the command line and from both batch and cgi scripts.

    You need an SMTP server to send from and a valid email account. You can send to multiple addresses.

    Examples that are working with Exchange here:

    c:\Blat -install 192.168.0.2 [email protected] -q

    c:\blat msg\bodyofmessage.txt -to [email protected] -s "Start of weekend - Maintenance"

    It is useful to have alternatives to the Outlook infested environment I have to work in...

    Leave a comment:


  • Michael Mattias
    replied
    I don't want a POP3 client. I don't want SMTP. I don't even want MAPI.

    I want an application to to "send email as a batch program you can execute on demand."

    I chose to do this version using the MAPI interface. Only thereafter did I learn that there are some limitations in one of your more popular MAPI Clients: Outlook Express.

    That's why I am thinking about doing a version to use SMTP, to both remove those restrictions and not require an installed MAPI client.

    BTW - he said in a shameless display of promoting someone else's work - I got my "first draft" of the help file for the current software from Frank Kelly of OnTop Systems, who has advertised here in the third-party forum.

    I was so impressed I simply could not send an email, I had to phone to let him know how pleased I was with his work. I never dreamt a 'first draft' could be this close to 'finished.'

    MCM

    Leave a comment:


  • John Petty
    replied
    Michael
    I think there is a little terminolgy confusion here. You don't need to bother about SMTP, you just need to write a pop3 client which is what MAPI normally uses, though it has other features. The samples in the downloads are complete including MIME encoding of attachments etc. Shouldn't take much extra time over the user interface you will need to write for MAPI anyway.
    John

    Leave a comment:


  • Michael Mattias
    replied
    My comment about the geeky system stuff is based on the fact that many of the code samples are in fact demos of a single function. (Including several of my own) .

    But an application requires more than one function, especially when it's Susie User who will be driving.

    MCM

    Leave a comment:


  • Michael Mattias
    replied
    >Guess you only look at your own posts for usable examples

    You gotta be kidding. I take plenty, which is why I try to give at least plenty.

    One From Column A, One from Column B..

    Leave a comment:


  • John Petty
    replied
    Originally posted by Michael Mattias View Post
    >Why not just write your own,

    My own what?

    I was creating an application designed specifically to "use your installed MAPI email client to send email as a batch program you can execute on demand."

    Matter of fact, I will probably be releasing the finished version of the above as "freeware" (well, there will be at least a little shameless self-promotion involved, a splash screen maybe) quite soon. I'm even paying someone to write a help file for it. (See, posting in the "Positions Offered" forum has made someone here a few shekels).

    However.... I am thinking about also creating a "use SMTP to send email as a batch program you can execute on demand" application. I think this would make a nice "matched set." Don't you?

    (I do applications, not all that geeky system stuff).


    MCM
    Nothing Geeky look at the tcp/ip samples in your whatever version install. Look forward to your batch files to do what so many code examples on these forums on a one off or as needed send an email. Guess you only look at your own posts for usable examples. If I had time I would offer to take the sheklels but no splash screen in PB the emails would be gone before the splash screen can display.

    Leave a comment:


  • Mike Doty
    replied
    SMTP:
    http://www.greatwebdivide.com/software_ddsmtp.htm

    Leave a comment:


  • Michael Mattias
    replied
    >Why not just write your own,

    My own what?

    I was creating an application designed specifically to "use your installed MAPI email client to send email as a batch program you can execute on demand."

    Matter of fact, I will probably be releasing the finished version of the above as "freeware" (well, there will be at least a little shameless self-promotion involved, a splash screen maybe) quite soon. I'm even paying someone to write a help file for it. (See, posting in the "Positions Offered" forum has made someone here a few shekels).

    However.... I am thinking about also creating a "use SMTP to send email as a batch program you can execute on demand" application. I think this would make a nice "matched set." Don't you?

    (I do applications, not all that geeky system stuff).


    MCM

    Leave a comment:


  • John Petty
    replied
    Michael
    Why not just write your own, much simpler and much more reliable, then you don't have to worry about which mail client is installed and all their different abilities. I got caught once in VB6, using COM to Outlook for a special customer, worked fine. He decided it would be nice to have it for another user who only had Express so of course it wouldn't work there.
    My accountant uses a major accounting package that sends reports by email, he uses Outlook, the program dumps the sent notifications into Express that is still installed but not used Duh.
    Some good examples in both the forums and download sections. I just have a small DLL which replaces the MAPI send functions so just add it into my programs with either an INI or Textboxes (or both) for each customers requirements.
    John

    Leave a comment:


  • John Strasser
    replied
    Hi Mike,

    While I haven't had a change to play with this using Thunderbird, outlook, or pegasus (the packages I've got installed). . .

    Just for grins - did you try creating another user account on the machine and the "Run As" your program?

    To the best of my knowledge, the "default email" is on a per user basis.

    Worth a try.

    Going back to homework now...
    JS

    Leave a comment:


  • Knuth Konrad
    replied
    Ah, I see. That sounds like a reasonable usage of the CC field.

    Leave a comment:


  • Michael Mattias
    replied
    Strangely enough, Knuth, they WANT the "CCs" shown.

    This is the "create PDF-files" invoice application I've mentioned here before.

    In some cases my client's customers want invoices sent to the 'home office' with a CC to the 'branch office' and in other cases they want the inverse.

    In either case, my client wants his customers to know who got copies.

    MCM

    Leave a comment:


  • Knuth Konrad
    replied
    I don't know the purpose of that application, but in general sending out emails (to outside recepients) with all emial addresses in the CC field, is considered back practice. You put the recipients in the BCC field instead.

    Depending on where that appilcation is used, this might even violate privacy laws (your not supposed to share any personal data, which an email address is, with a 3rd party).

    If that's an inhouse application, all's fine, though ...

    Leave a comment:


  • Mike Doty
    replied
    Using CDOSYS.DLL
    http://www.powerbasic.com/support/pb...ghlight=cdosys

    http://www.aspfree.com/c/a/Windows-S...ing-CDOSYSDLL/
    Last edited by Mike Doty; 26 Jul 2008, 05:52 PM.

    Leave a comment:


  • Michael Mattias
    replied
    I changed my OE default sender (using the provided interface, not by hand-editing the registry) and sure enough, the new default email was used as the "from."

    This particular customer application will be using an essentially dedicated machine, and for sure this will be the only email application on that box, so OE is very usable.

    MCM


    PS: I'd still be interested in anyone who DOES get "from address on demand" and which email client(s) actually listen when told.
    Last edited by Michael Mattias; 26 Jul 2008, 10:11 AM.

    Leave a comment:


  • David Warner
    replied
    With this being required for a customer application, I think avoiding this 'solution' would be sensible.

    It might create a situation where (as a colleague of mine used to say), 'things could get worse without limit'.

    David

    Leave a comment:


  • Michael Mattias
    replied
    Since this is being dropped in to customer application and he is having trouble installing the (required) MAPI client on the computer he will be using for this application, I have a better idea:

    "If you choose Outlook Express as your MAPI mail client for this application, the "From" will always be the default OE email account, as OE does not respect the commands to use another."

    (Hard to believe I was once a genuine hacker, huh?)

    MCM

    Leave a comment:


  • David Warner
    replied
    I did a little more research and found a related item.

    http://www.vbforums.com/showthread.php?t=503328

    Question: "How do I specify a different "From" address so that it does not use my default OE6 email address but my other email address instead?"

    Reply: You could monitor the registry and see how OE specifies the default account in the registry. Then change account defaults via code.


    It sounds a bit hacky perhaps (but interesting) so I went and found where OE6 stores its default account settings in the registry.

    http://www.insideoe.com/files/regkeys.htm#regIAMkey

    The Internet Account Manager registry key
    |-HKEY_CURRENT_USER
    |----Software
    |-------Microsoft
    |----------Internet Account Manager

    The 'Default Mail Account' key is set to the point at one of the account sub-keys.

    |-------------Accounts
    |----------------00000001
    |----------------00000002
    etc.

    > I can live with just about anything as long as I know what to expect.

    It might be sufficiently predictable then for your code to furtle around in the registry and...

    1) Look up and store the original 'Default Mail Account' value.
    2) Enumerate the available OE accounts retrieving their sub-key values.
    3) Set the "Default Mail Account" key to the sub-key of the one with a matching 'Account Name' to be specified in your code.
    4) Send the email from your code which would use the 'new' default.
    5) Set the "Default Mail Account" key back to its original value.


    David

    Leave a comment:


  • Michael Mattias
    replied
    Thank you for the info; very informative.

    Maybe someone with a mail client other than Outlook Express will try this and watch it work 'as I wanted it to' ... which would be just fine with me.

    I can live with just about anything as long as I know what to expect.

    Microsoft Outlook (non-Express) results would be of great interest to me.

    > am by no means expert in this area

    Join the crowd.

    MCM

    Leave a comment:


  • David Warner
    replied
    Hi Michael,

    I've tinkered with this and think perhaps it is a limitation of the Outlook Express Simple MAPI implementation. As far as I can tell it always picks up the senders name and email address from the default email account details in OE6.

    I am using Outlook Express 6.00.2900.5512

    The only way I have been able to send an email from your code with a different 'from' address is to change the default Outlook Express mail account within OE6.

    Outlook Express 6...
    Tools menu...
    Accounts menu...
    Mail tab...
    Select alternative account...
    Click [Set as Default] button

    I tried a couple of other things.

    1) In order to manually select another account (profile?), I tried getting the logon dialog box to appear by passing %MAPI_LOGON_UI to the MapiLogon call without success.

    According to http://msdn.microsoft.com/en-us/libr...EXCHG.10).aspx

    "A logon dialog box should be displayed to prompt the user
    for logon information. If the user needs to provide a password
    and profile name to enable a successful logon, MAPI_LOGON_UI
    must be set."

    Maybe I did something wrong, but I never saw a dialog box.


    2) I tried using an alternative account/password as the ProfileName/Password in the MapiLogon call which didn't work. Which it turns out is due to a Microsoft design choice.

    http://support.microsoft.com/kb/315503

    SYMPTOMS
    When Outlook Express is the default mail client, the MAPILogon function ignores the profile name and password parameters.

    CAUSE
    Because Outlook Express does not use profiles, MAPILogon uses the default identity.

    STATUS
    This behavior is by design.

    I am by no means expert in this area so you may find someone else will come up with a solution. Good luck.

    All the Best,

    David

    Leave a comment:

Working...
X