Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# Obtain Smtp Server Name

Status
Not open for further replies.

schwankieog

Programmer
Jul 25, 2001
43
US
Hi,
I am trying to write a code that sends an email. I am using SmtpMail. To send this email I need to set the property SmtpMail.SmtpServer. I really am trying to not make the user specify the Smtp server and would like to obtain via my code. Is there anyway to do this? I have searched the net in vain. ANY help would be greatly appreciated. Thank you for your time.
 
The docs say if you leave this property blank, it will use the SMTP server installed on Windows 2000 (if you installed that optional component). I imagine if you're running in an Active Directory environment, it might find an available server, but that would mean that that server had an open relay, which is bad news -- that's how a lot of spam gets sent, so sysadmins tend to close that hole first thing.

Chip H.
 
So ... I realize the localhost setting, but for some reason that doesnt seem to want to connect. any other suggestions?
 
schwankieog,

Couldn't this be set in the app.config file on installation?

Set up once, use many!

Craig
 
Check to see if the SMTP service is installed.

Chip H.
 
smtp is definitely installed. i keep getting the error unable to create cdo.message object. i have seen many instances of peopl complaining about this, but no real answers. again any help would be greatly appreciated.
 
Yeah, been to those sites. was able to get the dll working, but was hoping someone had found a better way than going back to sockets. guess not :/ thanks for all the post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top