ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Send mail from Excel (https://www.excelbanter.com/excel-programming/307551-send-mail-excel.html)

Steve C.[_3_]

Send mail from Excel
 
Hi,
I'm writing some codes that allow users to send e-mail
from Excel using CDO object. To make it work, I need to
provide the name of the SMTP server and I don't want to
hard code it in the program. I wonder is that any
functions that can get the SMTP server name in VBA so that
I can incorporate it in my codes?

Your help is much appreciated!

Regards,
Steve C.

Bob Phillips[_6_]

Send mail from Excel
 
Don't know the answer, but you could create an environment variable and read
that in the program.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Steve C." wrote in message
...
Hi,
I'm writing some codes that allow users to send e-mail
from Excel using CDO object. To make it work, I need to
provide the name of the SMTP server and I don't want to
hard code it in the program. I wonder is that any
functions that can get the SMTP server name in VBA so that
I can incorporate it in my codes?

Your help is much appreciated!

Regards,
Steve C.




Ron de Bruin

Send mail from Excel
 
Hi Steve

Never have look for something like this but look at this page
http://vbnet.mvps.org/

If you have setup a mail account in OE then CDO use the SMTP server from OE

More info about CDO you can find here
http://www.rondebruin.nl/cdo.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steve C." wrote in message ...
Hi,
I'm writing some codes that allow users to send e-mail
from Excel using CDO object. To make it work, I need to
provide the name of the SMTP server and I don't want to
hard code it in the program. I wonder is that any
functions that can get the SMTP server name in VBA so that
I can incorporate it in my codes?

Your help is much appreciated!

Regards,
Steve C.




Steve C.[_3_]

Send mail from Excel
 
Hi Ron and Bob, thanks for your help!

-----Original Message-----
Hi Steve

Never have look for something like this but look at this

page
http://vbnet.mvps.org/

If you have setup a mail account in OE then CDO use the

SMTP server from OE

More info about CDO you can find here
http://www.rondebruin.nl/cdo.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Steve C." wrote in

message ...
Hi,
I'm writing some codes that allow users to send e-mail
from Excel using CDO object. To make it work, I need to
provide the name of the SMTP server and I don't want to
hard code it in the program. I wonder is that any
functions that can get the SMTP server name in VBA so

that
I can incorporate it in my codes?

Your help is much appreciated!

Regards,
Steve C.



.



All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com