-
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
-
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
-
Replies: 4
Last Post: 12-15-2005, 04:23 PM
-
By Maria Jose Serres in forum dotnet.announcements
Replies: 0
Last Post: 05-28-2003, 10:34 AM
-
By Zahid Iqbal in forum dotnet.announcements
Replies: 0
Last Post: 05-20-2003, 07:06 AM
-
By Maria Jose Serres in forum dotnet.announcements
Replies: 0
Last Post: 02-19-2003, 02:54 PM
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks