Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 22nd, 2006, 07:04 PM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default Email will not send my visual studio 2003 project

Email will not send my visual studio 2003 project

1. I am using MSDE, IIS, Visual studio 2003, 1.1 netframework, I have mail Outlook and msn homail,

2. these are installed on windows xp

3. Can I send email if I only have msde and not a regular server?

4. The project works except the sending of the email

5. I thought I have coded below correctly, but I do not receive emails

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

        ' Fires when the application is started

        '1. Create a connection

        Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("c onnectionString"))

        myConnection.Open()

        '2. Create the command object, for the query

        Const strSQL As String = "Select LastUpdated, ProductId from products "

        Dim objCmd As New SqlCommand(strSQL, myConnection)

        Dim objDR As SqlDataReader

        Dim att

        objDR = objCmd.ExecuteReader()

        While (objDR.Read)

            If (Not (objDR("LastUpdated") Is DBNull.Value)) Then

                If (Date.Compare(objDR("LastUpdated"), Today.Date) = 0) Then

                    Dim newMail As New MailMessage

                    newMail.From = "from@from.com" '' this is the From Address

                    newMail.To = "kenn_rosie@msn.com" '' this is TO Address

                    'newMail.Cc = "hadeedian@hotmail.com" '' this is TO Address

                    newMail.Subject = "Change in Product Rate"

                    newMail.Body = " Dear Ken, " & "Please review attached email for product ID: " & objDR("ProductID") & "Thank you," & "Kenn()"

                    att = New MailAttachment("C:\Inetpub\wwwroot\GrocerToGo\Prod uct_Changed.doc")

                    newMail.Attachments.Add(att)

                    newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")

                    newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "username")

                    newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password")

                    SmtpMail.SmtpServer = "mailserver"

                    SmtpMail.Send(newMail)

                End If

            End If

        End While

        myConnection.Close() 'Close the connection

    End Sub
  #2 (permalink)  
Old February 25th, 2006, 07:26 PM
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

newMail.Attachments.Add(att)

what is the parameter 'att'; is it declared?

  #3 (permalink)  
Old February 27th, 2006, 11:15 AM
Authorized User
 
Join Date: Dec 2005
Location: bangalore, karnataka, India.
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to g_vamsi_krish
Default

before sending mail u need to configure u r smtp server.

if not configured follow these steps. try to send email to yahoo or gmail.

go to iis and select smtp virtual server properties. select Access in the tab.
select relay and click on add button.
select single computer and enter u r system ip address.

vamsi
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asking information about Visual Studio 2003 books hari_purwanto_ui ASP.NET 2.0 Basics 3 October 1st, 2007 08:54 AM
Visual Studio 2003 Not Responding pcliu Reporting Services 0 August 30th, 2006 03:12 AM
Visual Studio 2003 vs. Visual Studio 2005 eitanbarazani C# 2005 4 May 9th, 2006 01:34 AM
Visual Studio 2005 AND vs 2003 MAB VS.NET 2002/2003 1 December 27th, 2005 05:40 PM
Visual Studio 2002 Vs. 2003 psmothers BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 September 13th, 2004 09:52 PM



All times are GMT -4. The time now is 07:47 AM.


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