Email will not send my visual studio 2003 project


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Email will not send my visual studio 2003 project

  1. #1
    Join Date
    Nov 2005
    Posts
    46

    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("connectionString"))

    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\Product_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. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    See if this helps: http://www.systemwebmail.com/
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

Similar Threads

  1. Visual Studio Project Quesiton
    By jcb1269 in forum .NET
    Replies: 4
    Last Post: 12-15-2005, 04:23 PM
  2. Replies: 0
    Last Post: 05-28-2003, 10:34 AM
  3. Replies: 0
    Last Post: 05-20-2003, 07:06 AM
  4. ANN: Release of DeKlarit 2.0 for Microsoft Visual Studio .NET
    By Maria Jose Serres in forum dotnet.announcements
    Replies: 0
    Last Post: 02-19-2003, 02:54 PM
  5. yag's status report - March 21, 2002
    By Yair Alan Griver [MS] in forum vb.announcements
    Replies: 0
    Last Post: 03-21-2002, 05:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center