Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 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 September 24th, 2003, 10:44 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

From what I can see, that should be the last example you posted here.
Couldn't find a problem in that one:

Dim Body
Body = Request.Form("cust_name") & " " & Request.Form("cust_position") & " " & Request.Form("cust_organisation") & " " & Request.Form("cust_address") & " " & Request.Form("cust_telephone") & " " & Request.Form("cust_fax") & " " & Request.Form("cust_email")

If all of this is on one line, it should work.

Good luck, and I'd like to see the final code, if you want to.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 24th, 2003, 11:14 AM
Authorized User
 
Join Date: Jun 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar :)

This is the code that worked - in my yahoo browser it doesn't recognise the line spaces but will try viewing it in something else

<%
    Dim Body
    Body = "Customer name is " & Request.Form("cust_name") & vbCrLf & "Customer position is " & Request.Form("cust_position") & vbCrLf & "Customer organisation is " & Request.Form("cust_organisation") & vbCrLf & "Customer address is " & Request.Form("cust_address") & vbCrLf & "Customer telephone is " & Request.Form("cust_telephone") & vbCrLf & "Customer fax is " & Request.Form("cust_fax")

    Dim objNewMail
    Set objNewMail = Server.CreateObject("CDONTS.NewMail")
    objNewMail.From = Request.Form("cust_email")
    objNewMail.To = "[email protected]"
    objNewMail.Subject = "This is the subject"
    objNewMail.BodyFormat = CdoBodyFormatText ' or CdoBodyFormatHTML
    objNewMail.MailFormat = CdoMailFormatMime ' or CdoMailFormatText
    objNewMail.Body = Body
    objNewMail.Send

    Set objNewMail = Nothing
%>

Thanks for all your patience and help you are a star

Steve :)

 
Old September 24th, 2003, 11:34 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Great. Glad it worked.

Yahoo mail is HTML based, so it doesn't interpret a line feed / carriage return as a new line.

For that to work, change this:

.BodyFormat = CdoBodyFormatText ' or CdoBodyFormatHTML

to this:

.BodyFormat = CdoBodyFormatHTML

This indicates that the mail message contains HTML. Then, instead of adding a vbCrLf, you can add all kinds of fancy HTML:

Dim Body
Body = "Customer name is " & Request.Form("cust_name") & "<br> & "Customer position is " & Request.Form("cust_position") & "<br>"

This will add a simple line break between each line, but other stuff is possible too.

Depending on your target audience, you could create two e-mail routines; one that sends plain text (personally, I prefer that over HTML mail, as it usually isn't cluttered too much with colors, graphics etc) and one for HTML compatible e-mail programs like web mail systems, Outlook etc.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 17 Web Forms phenom BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 11 August 6th, 2010 08:25 AM
Web Forms - Chapter 17 lana BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 July 23rd, 2008 04:52 PM
Chapter 13 - Forms as objects Zave BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 0 August 22nd, 2007 12:23 AM
Chapter 20 -Forms based Authentication bshay BOOK: Beginning ASP.NET 1.0 2 October 7th, 2003 09:17 AM





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