Wrox Programmer Forums
|
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 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 October 26th, 2007, 04:38 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mail function

Oke i'm now making a new topic for the search function

but the same question

on the webshop part 9
i want to send an email to the customer and to me.

for customers is in the add on
but to a fixed email adres not?


ive edited the email functions to the webpage
all the things

but the customer doesn't gets a email?
I've checked with a breakpoint
i've set a breakpoint here:
                mySmtpClient.Send("[email protected]", emailAddress, theSubject, theMessage)

And when i debug it when i press the finalize order button it shows me that breakpoint

i'm not really sure what i did wrong?
is it maybe because of the email adres?
 
Old October 27th, 2007, 03:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

First, make sure that emailAddress contains a valid e-mail address.

Also, make sure your system is set up for sending e-mails. You either need an SMTP server on your local host (not recommended for security reasons) or need to configure a web server in the web.config file.

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
While typing this post, I was listening to: Spargi D'Amaro Pianto (Donizetti) by Maria Callas (Track 15 from the album: Maria Callas: The Voice Within the Heart) What's This?
 
Old October 29th, 2007, 03:52 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Oke it works i'm feeling such a noobie now
just forgot to define the server.

i'm pretty sure this is a dumb mistake but i'm sending the .txt mail but in every program (hotmail/outlook) he only show the html (it all works though) but he doesn't show the layout?

 
Old October 29th, 2007, 02:24 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Take a look here: http://p2p.wrox.com/topic.asp?TOPIC_ID=66126

Have you set IsBodyHtml??

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
 
Old October 30th, 2007, 03:02 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'm sorry but where do i put the IsBodyHtml tag?

i only have that in the global.asax file when a error is tossed.

 
Old October 30th, 2007, 04:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's a property of the MailMessage object that you need to set to True.

Can you post your code?

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
 
Old October 31st, 2007, 03:12 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I allready have that set to true :S

      Dim mySmtpClient As SmtpClient = New SmtpClient()
            Dim myMessage As MailMessage = New MailMessage("[email protected]", "[email protected]", subject, errorMessage.ToString())
      myMessage.IsBodyHtml = True

      mySmtpClient.Send(myMessage)
    End If
  End Sub

 
Old October 31st, 2007, 03: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

Then it should work. Does errorMessage contain valid HTML? E.g. HTML you would normally place between the <body> tags?

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
 
Old October 31st, 2007, 05:01 PM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just have this in the Confirm Message:

 
Quote:
quote:<body>
Quote:
  Beste klant,<br /><br />
  Bedankt voor je bestelling bij Itasc. Je bestelnummer is,
          <b>##OrderNumber##</b><br /><br />
  Hieronder vind je een lijst met producten die je bestelt hebt.
  De producten zullen worden verstuurd zodra we het geld binnen hebben.
  <br /><br />
  ##ShoppingCart##
  <br /><br />
  Bedankt,
  <br /><br />
  Itasc Webshop team.
</body>
 
Old October 31st, 2007, 05:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Try removing the <body> tags, make sure IsBodyHtml is really set to True before you send the message, make sure your message really contains HTML (set a breakpoint to find out) and make sure you have an HTML compliant mail reader. AFAIK, when all four are true, you should see an HTML formatted message.

Imar

BTW: Besteld is with a d not a t.... ;)

---------------------------------------
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





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





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