I've tried various ways to send and email on page 309 but am still having a problem. I get the following message:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 65.55.172.254:25.
Any help is appreciated.
Chuck
Source Error:
Line 13: Dim mySmtpClient As SmtpClient = New SmtpClient()
Line 14: mySmtpClient.EnableSsl = True
Line 15: mySmtpClient.Send(myMessage)
Line 16: End Sub
Line 17: End Class
Here's my code for the webconfig. I got some of it off a site I googled that showed how to set it up ASP.net with hotmail:
<system.net>
<mailSettings>
<smtp from="
[email protected]"> <network host="smtp.live.com"
defaultCredentials="false" port="25" userName ="chuck8556 @hotmail.com" password="xxxxxx" />
</smtp>
</mailSettings>
</system.net>
[/code]
Here's the code behind:
Code:
Imports System.Net.Mail
Partial Class Email
Inherits BasePage
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myMessage As MailMessage = New MailMessage()
myMessage.Subject = "Test Message"
myMessage.Body = "Hello world, from Planet Wrox"
myMessage.From = New MailAddress("[email protected]", "Sender Name Here")
myMessage.To.Add(New MailAddress("[email protected]", "Receiver Name Here"))
Dim mySmtpClient As SmtpClient = New SmtpClient()
mySmtpClient.EnableSsl = True
mySmtpClient.Send(myMessage)
End Sub
End Class