[DUG] SMTP settings

Jolyon Smith jsmith at deltics.co.nz
Mon Sep 19 09:30:00 NZST 2011


The first problem I see is that there is no way to be sure that your user's
"default email program" even uses SMTP.  Even if they are using Outlook,
they may be using Exchange, or an IMAP server by default.  If they aren't
using Outlook then I'm not even sure you can be certain that any other email
client will be storing it's account data as part of the Windows Mail
framework.

Being able to ask any unknown email application to give up it's internal
configuration settings I think is asking too much... I don't think there is
any standard - or any requirement for any standard - interface which email
applications _must_ conform to for setting/retrieving such internal
configuration details.


But all is not lost... if the settings you need _are_ actually maintained as
part of the Windows > Control Panel > Mail settings (as in the case of
Outlook) then you should be able to retrieve this information quite easily.
 Whether there is a specific API in Windows for accessing this information,
or you have to roll up your sleeves, cross your fingers and just go digging
in the file system, I cannot say.  It seems at least that there *used* to be
an API, but the Accounts aspect of this is deprecated:

http://msdn.microsoft.com/en-us/library/ms709603(v=VS.85).aspx

(the system for storing these settings changed as of Windows Vista, when
they moved out of the registry and into the file system).

Good luck.

:)

On 17 September 2011 22:15, John Bird <johnkbird at paradise.net.nz> wrote:

>   I asked this before but there was no answer, so I am trying again – I
> have made a nice Indy 10 based unit that I can send email from – ie it an
> assemble the SMTP settings, Subject, body, attachments, and send with some
> nice logging.
>
> The only part missing is I would like to get the SMTP settings from the
> default Mail program......rather than having to require the user to find and
> input these.   Is there a way to find what these are set to?   I am happy to
> assume that the users are using Outlook, as almost all of them are), so just
> enquiring from Outlook settings what the default account SMTP server setting
> and SMTP port number is would be real convenient.
>
> Anyone got suggestions?
>
> John
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20110919/b22a4f5a/attachment.html 


More information about the Delphi mailing list