Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2010, 10:37 AM
Registered User
 
Join Date: Mar 2010
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default CHAPTER 15,PAGE 533

Hi.

I really hope with p2p programmer guide can help me to solve this problem.

Well, I have search all the thread about this Chapter 15 on page 533 posted by other user.

However,the solution provided on the previous thread is not helping me.

Besides that, most of the solution is in C# language.Please help me,i'm using VB language.

I hope the solution that you will provide later wouldn't ask me to see other link or thread about this matter because I have look at it before.

Just,please guide me with a step-by-step approach about the topic on page 532 and 533.I will appreciate your kind and sincere help.

Last edited by dyla; April 13th, 2010 at 10:40 AM..
 
Old April 13th, 2010, 01:25 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And what is the problem exactly? I don't feel like going through hundreds of posts looking for a problem while, apparently, you know exactly what it is about and even have links to similar posts.

Can you elaborate?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 14th, 2010, 09:58 AM
Registered User
 
Join Date: Mar 2010
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default Thanks Imar

From your reply:"You're mixing up variable names and type names.
This is not correct:
Dim SmtpClient As mySmtpClient = New SmtpClient()
The syntax is: Dim variableName As TypeName = New TypeName() "

Well,thank a lot for your assistant regarding my previous question.

I did retype and chang my code to your suggestion.And as a result, I received this error message.

Code:
Server Error in '/' Application.
--------------------------------------------------------------------------------

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: BC30002: Type 'mySmtpClient' is not defined.

Source Error:

 

Line 6:  
Line 7:  
Line 8:          Dim SmtpClient As mySmtpClient = New mySmtpClient()
Line 9:          mySmtpClient.EnableSsl = True
Line 10:         mySmtpClient.Send(e.Message)


I'm using VB language.

This is my code in SendingMail event:

Code:
Partial Class SignUp
    Inherits System.Web.UI.Page

    Protected Sub CreateUserWizard1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles CreateUserWizard1.SendingMail


        Dim SmtpClient As mySmtpClient = New mySmtpClient()
        mySmtpClient.EnableSsl = True
        mySmtpClient.Send(e.Message)
        e.Cancel = True
    End Sub

 
End Class
And this is my coding in web.config:
Code:
<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="myEmailIdName@hotmail.com">
        <network
          port="587"
          userName="myEmailIdName@hotmail.com"
          password="mypassword"
          host="smtp.live.com"
      />
      </smtp>
    </mailSettings>
  </system.net>
Now, I really don't know what to do....only SignUp.aspx page cannot send the email confirmation.

For ContactUs.aspx is running smoothly.

Anyway,...thank you so much for helping.
 
Old April 14th, 2010, 10:01 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You haven't changed a thing in your code; you're still using:

Dim SmtpClient As mySmtpClient = New SmtpClient()

which is *NOT* correct.

Do you know in the statement above where the variable name (which you can make up)goes and where the type name (which is a fixed name) goes? I can tell you how to fix it, but you'll better understand it if you can find this out yourself.

Take a look at my initial statement again: You're mixing up variable names and type names

Hope this helps; if not, let me know.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
dyla (April 14th, 2010)
 
Old April 14th, 2010, 12:52 PM
Registered User
 
Join Date: Mar 2010
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Thumbs up Sending email successful!!

After a few second I post the previous thread, I still keep trying and trying.

Well yes.You are right.

Based on your comment:



You're mixing up variable names and type names.
This is not correct: Dim SmtpClient As mySmtpClient = New SmtpClient()
The syntax is: Dim variableName As TypeName = New TypeName()

Well, yes.

This is the right code.

Code:
Imports System.Net.Mail

Partial Class SignUp
    Inherits System.Web.UI.Page

    Protected Sub CreateUserWizard1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles CreateUserWizard1.SendingMail


        Dim mySmtpClient As SmtpClient = New SmtpClient()
        mySmtpClient.EnableSsl = True
        mySmtpClient.Send(e.Message)
        e.Cancel = True
    End Sub


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
End Class
This is inside SendingMail event.
VB language.
Thanxxx Imar !!!!!

I love wrox!!


No regrets buying ur books
 
Old April 14th, 2010, 01:20 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, exactly! Glad it's working now...

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 15, Page 532-533 Loophole3 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 September 13th, 2009 05:45 AM
Chapter 1 errata - Northwind - page 15 MikeTheFid BOOK: Professional ADO.NET 3.5 with LINQ and the Entity Framework ISBN: 978-0-470-22988-0 0 July 29th, 2009 11:03 AM
Chapter 15 p.774 at the top of page shade cat BOOK: Ivor Horton's Beginning Visual C++ 2005 0 June 5th, 2007 03:04 PM
Unclear instructions in chapter 1 page 15 Merocal BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 17 January 14th, 2007 06:54 PM
Chapter 15 Page 711 JOHNW BOOK: Beginning ASP 3.0 3 January 14th, 2004 11:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.