View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default CDO, SMTP Server Name, and Excel's SendMail Method

If the user have a account in OE or Windows mail there is no need to fill in the SMTP server
http://www.rondebruin.nl/cdo.htm

There is code on this site if you want to know the SMTP server from Outlook
http://vbnet.mvps.org/


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Greg Lovern" wrote in message ups.com...
I have an Excel VBA macro that sends mail using CDO. Works fine, but
users have to enter their SMTP Server in a designated cell.

In case a user doesn't know his SMTP Server, I allow the user to
choose, in a dropdown, whether to use CDO or Excel's SendMail, since
Excel's SendMail Method does not require specifying an SMTP Server.
Instead, according to the function reference, it uses "the installed
mail system" to send mail.

But CDO is much more versatile than Excel's SendMail, so I'd prefer to
be able to use CDO without expecting the user to know his SMTP Server.

Obviously, Excel's SendMail is somehow figuring out the SMTP Server.
I've found code to do this if the user has a mail account set up in
Outlook Express, but whatever Excel does works with or without an
Outlook Express mail account set up.

If Excel can do it, surely it must be possible to do it in another
program too. How can I determine the SMTP Server without regard to
what mail program is installed and set up with a mail account?


Thanks,


Greg