I have been trying to do the "Try it out" on page 319 for the last couple of days. I have been unsuccessful in everything that I have tried. I installed SP 1 in VS 2010 that I am using and it still does not work. Here is the web.config code that I am using.
<add tagPrefix="Wrox" tagName="Banner" src="~/Controls/Banner.ascx"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
<smtp deliveryMethod="SpecifiedPickupDirectory" from ="info@PlanetWrox.com">
<!--<smtp deliveryMethod="Network" from="Fred Fenk <firstname.lastname@example.org>">
<network host="smtp.gmail.com" userName="email@example.com" password="juliana0603"/>-->
As you can see that I have tried both of the methods that you recommended.
Below is the vb
code behind the Email.aspx that you instructed for us to code in the vb
Dim myMessage As MailMessage = New MailMessage()
myMessage.Subject = "test message"
myMessage.Body = "Hello World, from Planet Wrox"
myMessage.From = New MailAddress("firstname.lastname@example.org", "Fred Fenk")
myMessage.To.Add(New MailAddress("email@example.com", "Fred Fenk"))
Dim mySmtpClient As SmtpClient = New SmtpClient()
It just will not send the message. That is the error that I am getting. I am at a loss because I cannot do the next "Try it out" or anything in chapter 10 until I get this resolved.
I have tried the SpecifiedPickupDirectory and it does not work. The error keeps on pointing to the "mySmtpclient.Send(myMessage)" line of code in my VB
code. I have looked on the internet for other suggestions and they talk about schemas that need to be included in the code. But if I try to just write to my c drive why would I need schemas. I cannot even write to my c drive.
Please advise, I really need help.