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.<div>
<br></div><div>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.</div>
<div><br></div><div><br></div><div>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:</div>
<div><br><a href="http://msdn.microsoft.com/en-us/library/ms709603(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/ms709603(v=VS.85).aspx</a></div><div><br></div><div>(the system for storing these settings changed as of Windows Vista, when they moved out of the registry and into the file system).</div>
<div><br></div><div>Good luck.</div><div><br></div><div>:)<br><br><div class="gmail_quote">On 17 September 2011 22:15, John Bird <span dir="ltr"><<a href="mailto:johnkbird@paradise.net.nz">johnkbird@paradise.net.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr" lang="EN-NZ" vlink="purple" link="blue">
<div dir="ltr">
<div style="font-family:'Arial';color:#000000;font-size:10pt">
<div>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.</div>
<div> </div>
<div>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.</div>
<div> </div>
<div>Anyone got suggestions?</div>
<div> </div><font color="#888888">
<div style="font-family:'Arial';color:#000000;font-size:10pt">John</div></font></div></div></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>