Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
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 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 February 22nd, 2006, 07:04 PM
Authorized User
 
Join Date: Jan 2006
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 = "[email protected]" '' this is the From Address

                    newMail.To = "[email protected]" '' this is TO Address

                    'newMail.Cc = "[email protected]" '' 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
 
Old February 25th, 2006, 07:26 PM
Authorized User
 
Join Date: Mar 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

newMail.Attachments.Add(att)

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

 
Old February 27th, 2006, 11:15 AM
Authorized User
 
Join Date: Dec 2005
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





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





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