|
-
May 23rd, 2003, 01:14 PM
#1
Thread Starter
Lively Member
Sending Email without using SMTPServer details
Hi all,
I need to send a mail from my web page. I got the sample to send the mail using system.web.mail class and thus by creating an object of mailmessgae(). But there I have to give the value for SmtpMail.SmtpServer. I'm not sure about the clients SMTP server details.
Is there any other way to send mail without giving the value of SmtpMail.SmtpServer?.
I think this was possible with ASP's CDONTS. Is there any equivalent code in ASP.NET?
PLease help
when in doubt, win the trick
-
May 23rd, 2003, 04:47 PM
#2
PowerPoster
If your sending the mail from your page, you use your smtp server.
So, if your page is www.something.com you will probably use mail.something.com as the smtp server (you will have to check with your hosting company for the exact one). All you are doing is setting how your asp.net app is going to send the mail. It has nothing to do with the client.
-
May 24th, 2003, 12:38 AM
#3
Thread Starter
Lively Member
yes. I meant the hosting company not the client
But In classic ASP, that can be done without giving those address. right?.
And that means In case if I'm doing a site for a third party who is not decided where and when to host yet, what would I do?.
Should I 've change the code then?
Thanks Mr.hellswraith for your response.
when in doubt, win the trick
-
May 24th, 2003, 10:30 AM
#4
PowerPoster
Take a look at this thread:
http://www.vbforums.com/showthread.p...hreadid=246409
It gives a way to store the connection string in the web.config file. You can do the same for the smtp server. Since the web.config file is just an xml file, the end user can open it up, add in their smtp server, and they are done.
You just need to give them instructions on how to perform this (open the file in notepad, find the smtp server element, change to their smtpserver).
Also, with traditional ASP, you relied on 3rd party components to send mail. They also require a smtp server. If you host had these components installed, then they configured them for your use already, that is why you never had to deal with it.
-
May 26th, 2003, 04:53 AM
#5
Thread Starter
Lively Member
Thanks again Mr.Hellswraith.
Nice solution. Thanks.
... and in traditional ASP I just used the CDONTS object. The code sequence was as follows..
Set objMsg = Server.CreateObject("CDONTS.NewMail")
objMsg.BodyFormat = 0
objMsg.MailFormat = 0
objMsg.From = "[email protected]"
objMsg.To = "[email protected]"
objMsg.Subject = "Greeting"
objMsg.Body = "Hi"
objMsg.Send
Set objMsg = Nothing
any suggestions?
when in doubt, win the trick
-
May 26th, 2003, 10:45 AM
#6
PowerPoster
You may have, but I used something like jmail or something. So, this would pose a problem when you tried to distribute your code, because you didn't know what object the person had on their server. If I released code for jmail, and sent it to you, you wouldn't be able to use it unless you also had jmail, or you would have to re write the code to make it work with your CDONTS object.
Now with the .Net framework, we don't have to worry. The only thing that needs to be configured is the smtp server.
Good luck.
-
May 27th, 2003, 01:31 AM
#7
Thread Starter
Lively Member
Okey Mr.Hellswraith, I have to it in .NET anyway.
Thanks for your patience
when in doubt, win the trick
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|