Solved

SMTP hostname on my webserver for asp.net page

Posted on 2009-05-04
7
660 Views
Last Modified: 2012-06-21
Hi,

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?
Thanks.
0
Comment
Question by:dkim18
  • 3
  • 2
  • 2
7 Comments
 
LVL 39

Accepted Solution

by:
abel earned 270 total points
Comment Utility
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.
0
 
LVL 15

Assisted Solution

by:oobayly
oobayly earned 230 total points
Comment Utility
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.
0
 

Author Comment

by:dkim18
Comment Utility
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.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 15

Expert Comment

by:oobayly
Comment Utility
When you say client side, you mean that you're using the web browser to send the email?
0
 
LVL 39

Expert Comment

by:abel
Comment Utility
> 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?
0
 

Author Comment

by:dkim18
Comment Utility
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.
Thanks.
0
 
LVL 39

Expert Comment

by:abel
Comment Utility
glad you found it and got it working! Tx ;)
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now