View Single Post
  #1 (permalink)  
Old March 31st, 2011, 12:00 PM
fredfenk fredfenk is offline
Registered User
Join Date: Mar 2011
Location: Ellenton, Fl
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Try it out on page 319

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.

<pages theme="Monochrome">
<add tagPrefix="Wrox" tagName="Banner" src="~/Controls/Banner.ascx"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
<smtp deliveryMethod="SpecifiedPickupDirectory" from ="">
<specifiedPickupDirectory pickupDirectoryLocation="c:\maildrop\"/>
<!--<smtp deliveryMethod="Network" from="Fred Fenk &lt;;">
<network host="" userName="" 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 code.

Dim myMessage As MailMessage = New MailMessage()
myMessage.Subject = "test message"
myMessage.Body = "Hello World, from Planet Wrox"
myMessage.From = New MailAddress("", "Fred Fenk")
myMessage.To.Add(New MailAddress("", "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.

Fred Fenk
Reply With Quote