Solved

SMTP hostname on my webserver for asp.net page

Posted on 2009-05-04
7
691 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
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.
0
 
LVL 15

Assisted Solution

by:oobayly
oobayly earned 230 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.
0
 

Author Comment

by:dkim18
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:oobayly
ID: 24298658
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
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?
0
 

Author Comment

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

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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