Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 1st, 2007, 12:51 AM
Authorized User
 
Join Date: Jul 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Send e-mail by Visual Web Developer 2005

Can I test mail programs in visual web developer 2005(means with the in built web server)? Do I need to configure smtp server?
 
Old August 1st, 2007, 07:49 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you want to send mail you will need to connect to a valid SMTP server. Typically your ISP will have a mail server you can drop messages onto. Check your providers website for information about the SMTP server address to use.

-Peter
 
Old August 1st, 2007, 03:13 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Alternatively for testing, if you are running XP Pro (or Vista Home Preiumum on up) you can use the SMTP service that you can install as part of IIS. This is an SMTP server only in the aspect that you can send mail through it you can not setup mail boxes, aliases, etc.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
 
Old August 2nd, 2007, 06:46 AM
Authorized User
 
Join Date: Jul 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for ur reply. But I couldn't find any related answer to my query....
 
Old August 2nd, 2007, 08:12 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Quote:
quote:Originally posted by dipanjan22
 Do I need to configure smtp server?

Are you asking if you need to configure the .NET SMTP class to point to an SMTP server?

Or are you asking if you need to set up an SMTP server to use?

Either way, I think we've answered most of both questions. You can set up an SMTP server if you wish to, but you can also use one that will allow you to send mail (i.e. your ISP's mail server).

-Peter
 
Old August 2nd, 2007, 01:05 PM
Authorized User
 
Join Date: Jul 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry! but perhaps my question is not very much clear by itself. I have IIS installed with support for .net 1.1 and smtp server. I want to send email from my web page by using my localhost. Can I? if yes then how? Please help!!
 
Old August 2nd, 2007, 09:21 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

To define the mail server do something like this:

SmtpMail.SmtpServer = "127.0.0.1"
or
SmtpMail.SmtpServer = ""

either of those will resolve to sending an email through your localhost smtp server but, by default, if you don't set this property, .NET will try to send the mail through your localhost anyway so I am not sure what your problem is.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
 
Old August 3rd, 2007, 01:41 PM
Authorized User
 
Join Date: Jul 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The messages are shown as sent but they are actually not. They get stacked up in the queue folder under mailroot folder in the inetpub folder. what could be the possible reasons?

 
Old August 3rd, 2007, 02:59 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

...A million things could be wrong. Post your source code.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Professional Search Engine Optimization with ASP.NET

Professional IIS 7 and ASP.NET Integrated Programming

================================================== =========
 
Old August 4th, 2007, 12:14 AM
Authorized User
 
Join Date: Jul 2007
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My code listed below just has a single button which when clicked send a mail to the id already hard coded in the code. Hope this won't pose any problem.
________________________________________
<%@ Page Language="VB" %>
<% @Import Namespace="System.Web.Mail" %>

<script runat="server">
Sub btnSend_Click(sender as Object, e as EventArgs)


  Dim maiLobj as New MailMessage()

  maiLobj.To = "1.dipanjan@gmail.com"
  maiLobj.From = "dipanjan@yahoo.co.in"


   maiLobj.Subject = "Test mail"
  maiLobj.Body = "Test mail. Please ignore"

  maiLobj.Priority = MailPriority.Normal
  maiLobj.BodyFormat = MailFormat.Text





   SmtpMail.SmtpServer = "127.0.0.1"

  'Now, to send the message, use the Send method of the SmtpMail class
  SmtpMail.Send(objMM)
msgbox("Mail Sent")
End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Sending mail by ASP.NET</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

     <asp:button runat="server" id="btnSend" Text="Send Mail!"
       OnClick="btnSendFeedback_Click" />

    </div>
    </form>
</body>
</html>







Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Web Developer 2005 dipanjan22 ASP.NET 1.x and 2.0 Application Design 2 July 12th, 2007 12:22 AM
SQL Server 2005 using Visual Web Developer carswelljr SQL Server 2005 1 September 14th, 2006 12:43 PM
visual web developer 2005 carswelljr VB How-To 2 September 13th, 2006 03:40 PM
Microsoft Visual Web Developer 2005 Express Editio FT BOOK: ASP.NET Website Programming Problem-Design-Solution 10 April 24th, 2006 12:25 AM
SQL Server 2005 Express with Visual Web Developer steffteo SQL Server 2005 1 March 19th, 2006 04:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.