SMTP hostname on my webserver for asp.net page

Posted on 2009-05-04
Medium Priority
Last Modified: 2012-06-21

I am trying to create  this asp.net web page which sends out email.
I need the smtp hostname of my webserver but my web server folks are not so helpful. Either they don't know where to find that name or don't know if that's been configured on the web server.

How can I look for this smtp hostname so I can write it in SmtpMail class in asp.net?

If I can't find it, I just do it in html.
I used Server.CreateObject('CDONTS.NewMail') object to email.
Why is it so hard for me to find this smtp hostname??
Is there a way I can guess it if know the domain name, say, something.com?
Question by:dkim18
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 39

Accepted Solution

abel earned 1080 total points
ID: 24298184
That's unfortunately not so trivial. Either you have access to the MX records of your DNS configuration and you can just look it up, or you do not, and you can only find it by trial and error.

You can try a telnet session to the SMTP port (25) using some of the more commonly used names, like smtp.example.com, mail.example.com, sendmail.example.com. If it is non of them, you are a bit out of luck.

Normally, when your hosting provider sets up your account they send you the information, including the SMTP information. It may also be that they did not set it up correctly for you or that they did not include a SMTP service. In which case you can always resort to the default outgoing mail server of your hosting provider, the same one that is configured in your Outlook / Thunderbird / Pegasus mail client.

You seem to use ASP.NET. In the case, you do not need CreateObject. You can just use the System.Net.Mail.* objects and classes directly.
LVL 15

Assisted Solution

oobayly earned 920 total points
ID: 24298308
What do you mean by "do it in html"?
Determining the smtp server name is only going to be possible by speaking to your hosting providers (or server admin). There's no standard name for them, for example 1 & 1 hosting have auth.smtp.1and1.co.uk, but on Port 587 rather than 25. It sounds like shear laziness on their behalf.

Though, if using CDONTS without specifying a hostname, it sounds like it's using the local IIS SMTP Server. To be honest it's been a very long time since I've used CDONTS.

Author Comment

ID: 24298560
I am at the client site and the web server folks don't reply to my request. My client and I have no control over them unfortunately.
I guess I just have to do with the CDONTS class.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 15

Expert Comment

ID: 24298658
When you say client side, you mean that you're using the web browser to send the email?
LVL 39

Expert Comment

ID: 24298856
> I guess I just have to do with the CDONTS class.

I don't understand. The way you are coding this, has nothing to do with the name of the server. You will have to configure that anyway. You say "you just do it in html", but it is impossible to send email by using html, what do you mean by that (this is a repetition of the question of oobayly, it is important to follow-up, so we can help you in the right direction).

What is the url of the website that you think also has an SMTP server behind it somehow?

Author Comment

ID: 24308088
Thanks guys.

 Sorry for the confusion.
I said that because I don't remember putting any smtp information when I used the CDONTS.
It is running on the same webserver.

Anyway, I found another web developer who had the smtp sever name.
LVL 39

Expert Comment

ID: 24309045
glad you found it and got it working! Tx ;)

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question