Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #31 (permalink)  
Old November 9th, 2007, 04:16 AM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the whole mail works creat i can bcc it and all.

but in Outlook Express the table is formatted nice.
Only the body has the standard font of the mailprogram.

How can i set this to always be 1 font?

isnt; that in the statistext file:

Body style"font=Tahoma" or something like that?

Reply With Quote
  #32 (permalink)  
Old November 10th, 2007, 05:31 AM
Imar's Avatar
Wrox Author
Points: 65,708, Level: 100
Points: 65,708, Level: 100 Points: 65,708, Level: 100 Points: 65,708, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 15,975
Thanks: 64
Thanked 1,350 Times in 1,330 Posts
Default

HTML mail is always a little tricky to format, as you can't really use external style sheets as you would with ASPX pages.

However, in-line styles would work fine:

<table>
<tr>
  <td style="font-family: Arial">Some Text</td>
</tr>
</table>

In this example, the style is applied to a td, but you can of course also apply it to other elements like the <table>

For the benefit of the archive of this forum, would you mind posting your final code?

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Reply With Quote
  #33 (permalink)  
Old November 13th, 2007, 02:53 AM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey imar offcourse i will post my codes wich ones do you want here?

Everything now works the only thing is when i publish it through visual studio i get these errors :S (really weard becouse it works in local mode)

Error 1 C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\Betaal.aspx(57): error BC30554: 'ShoppingCartView' is ambiguous. C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\Shop\Default.aspx 1
Error 2 'ShoppingCartView' is ambiguous. C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\Betaal.aspx 57
Error 3 'ShoppingCartView' is ambiguous. C:\Documents and Settings\Christian\Mijn documenten\Visual Studio 2005\WebSites\Nieuwe map\WebShop\shopc.aspx 10

And when i give them all diffrent names he still sas that from other pages really weard :S

Reply With Quote
  #34 (permalink)  
Old November 13th, 2007, 03:23 AM
Imar's Avatar
Wrox Author
Points: 65,708, Level: 100
Points: 65,708, Level: 100 Points: 65,708, Level: 100 Points: 65,708, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 15,975
Thanks: 64
Thanked 1,350 Times in 1,330 Posts
Default

Take a look in the code behind. You should see something like _Default Inherits System.Web.UI.Page

Maybe you have multiple _Default classes? If you change that, make sure you also change the ASPX file which contains a reference the same class.

Re code: whatever you ended up with to send mail, so future visitors to this forum know how you fixed it.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #35 (permalink)  
Old November 13th, 2007, 03:47 AM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No i don;t have multiple Default classes or other classes

But when i change for example Wrox:ShoppingCartView to My:ShopView It works doesn;t give an error on that page but on the page wich links from it does give an error :S

But aint it strange that it works on local and not on a publisher

Reply With Quote
  #36 (permalink)  
Old November 13th, 2007, 03:59 AM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oke i just uploaded it using filezilla that atleast justs uploads it.

But i get a Configuration Error:

Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 20: </connectionStrings>
Line 21: <system.web>
Line 22: <authentication mode="Forms">
Line 23: <forms loginUrl="~/Registreer.aspx"/>
Line 24: </authentication>


Source File: \webshop\web.config Line: 22

Reply With Quote
  #37 (permalink)  
Old November 13th, 2007, 04:04 AM
Imar's Avatar
Wrox Author
Points: 65,708, Level: 100
Points: 65,708, Level: 100 Points: 65,708, Level: 100 Points: 65,708, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 15,975
Thanks: 64
Thanked 1,350 Times in 1,330 Posts
Default

Yeah, very strange indeed. Sounds like a configuration problem, or maybe there are files missing, or extra files with a different name? Try clearing the remote folder first and then do a clean upload.

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #38 (permalink)  
Old November 13th, 2007, 06:45 AM
Imar's Avatar
Wrox Author
Points: 65,708, Level: 100
Points: 65,708, Level: 100 Points: 65,708, Level: 100 Points: 65,708, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 15,975
Thanks: 64
Thanked 1,350 Times in 1,330 Posts
Default

A quick Google search should give you plenty of results on this error. Basically, the folder this application resides in must be marked as a virtual directory (under IIS) or you should move it to the root of the site.

Can you please start new threads for new topics? This is in no way related to "Mail function" anymore, making things a bit more difficult and confusing.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
  #39 (permalink)  
Old November 14th, 2007, 04:54 AM
Authorized User
 
Join Date: Oct 2007
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oh jeah sorry i forgot

But here is the code for the mail function:

The statictext is cleared dind't changed much just deleted the html and body tags.

Helpers class:
 
Quote:
quote: Public Shared Sub SendConfirmationMessage( _
Quote:
          ByVal theShoppingCart As ShoppingCart, ByVal orderId As Integer, _
          ByVal emailAddress As String)

        Try
            Dim myGridView As GridView = CreateGridView()
            myGridView.DataSource = theShoppingCart.Items
            myGridView.DataBind()

            If myGridView.Rows.Count > 0 Then
                myGridView.FooterRow.Cells(0).Text = "Totaal:"
                myGridView.FooterRow.Cells(3).Text = _
                         String.Format("{0:c}", theShoppingCart.Total)

                Dim theSubject As String = "Je bestelling bij Itasc"
                Dim theMessage As String = My.Computer.FileSystem.ReadAllText _
                  (AppConfiguration.ConfirmationMessageLocation)


                Dim mySmtpClient As New System.Net.Mail.SmtpClient
                theMessage = theMessage.Replace("##ShoppingCart##", _
                GetHtmlFromControl(myGridView))
                theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
                Dim myMessage As MailMessage = New MailMessage("stage1@itasc.nl", emailAddress, theSubject, theMessage)
                myMessage.IsBodyHtml = True
                myMessage.Bcc.Add("stage1@itasc.nl")
                'myMessage.Bcc.Add("dennis@itasc.nl")
                'myMessage.Bcc.Add("inge@itasc.nl")
                mySmtpClient.Send(myMessage)

            End If
            'Public Shared Sub SendConfirmationMessage( _
            ' ByVal theShoppingCart As ShoppingCart, ByVal orderId As Integer, _
            ' ByVal emailAddress As String)

            ' Try
            ' Dim myGridView As GridView = CreateGridView()
            ' myGridView.DataSource = theShoppingCart.Items
            ' myGridView.DataBind()

            ' If myGridView.Rows.Count > 0 Then
            ' myGridView.FooterRow.Cells(0).Text = "Totals:"
            ' myGridView.FooterRow.Cells(3).Text = _
            ' String.Format("{0:c}", theShoppingCart.Total)

            ' Dim theSubject As String = "Your order at Wrox WebShop"
            ' Dim theMessage As String = My.Computer.FileSystem.ReadAllText _
            ' (AppConfiguration.ConfirmationMessageLocation)

            ' 'Dim myMailMessage As New System.Net.Mail.MailMessage
            ' 'myMailMessage.IsBodyHtml = True
            ' 'theMessage = theMessage.Replace("##ShoppingCart##", _
            ' ' GetHtmlFromControl(myGridView))
            ' 'theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
            ' 'Dim myClient As New System.Net.Mail.SmtpClient
            ' 'myClient.Host = "itascsrv01"
            ' 'myClient.Send(myMailMessage)

            ' Dim mySmtpClient As New System.Net.Mail.MailMessage
            ' mySmtpClient.IsBodyHtml = True
            ' theMessage = theMessage.Replace("##ShoppingCart##", _
            ' GetHtmlFromControl(myGridView))
            ' theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
            ' Dim mClient As New System.Net.Mail.SmtpClient
            ' mClient.Host = "itascsrv01"
            ' mClient.Send("stage1@itasc.nl", emailAddress, theSubject, theMessage)
            ' End If
        Catch ex As Exception
        End Try
    End Sub
End Class
And all the other files i dind't change anything that made it working or not ;)

I hope it will help other people ;)

Reply With Quote
  #40 (permalink)  
Old November 14th, 2007, 05:00 AM
Imar's Avatar
Wrox Author
Points: 65,708, Level: 100
Points: 65,708, Level: 100 Points: 65,708, Level: 100 Points: 65,708, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 15,975
Thanks: 64
Thanked 1,350 Times in 1,330 Posts
Default

Great. Thanks for the follow up.

BTW: did you know that [quote] is to quote someone, while [code] is to represent code in these messages? Using [code] you get a fixed width font which makes things easier to read.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
mail function remo Beginning PHP 0 July 16th, 2007 05:45 AM
mail function sunsetbay Beginning PHP 5 July 3rd, 2005 08:59 PM
can't seem to get the mail() function to work Graham76 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 5th, 2004 01:59 PM
mail () function Mark200408 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 September 30th, 2004 07:59 AM



All times are GMT -4. The time now is 08:46 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.