Emailing Form Results in HTML

Emailing Form Results in HTML

am 10.07.2007 19:16:02 von Rob

Hi,

I have a form (it works fine) but what I want to do is email the form
exactly as it is with the populated information. In otherwords, I want the
email sent to look just like the form that was filled out. I was able to get
it close but the problem I am having is that the form has a table in it and
the table uses a background JPG; but for some reason image is not being
included in the email and I'm stumped as to how to get it in there where it
belongs.

Here's the code I am using in the email function/sub.....

CODE:

Set msgMail=CreateObject("CDO.Message")
msgMail.From = Request("email")
msgMail.To = "someone@someone.com"
msgMail.Subject = "Response To Request"
msgMail.HTMLBody = " " & _
"" & _

"*********************************************************** ************************
" & _
"

style="background-image:url('table_background.jpg');backgrou nd-repeat:no-repeat;font-family:Arial;font-size:10pt;font-we ight:bold;color:#000000;"
width=""703"" height=""490"" border=""0"" cellpadding=""0""
cellspacing=""0"">" & _
"
" & _
" Style=""font-family:Arial;font-size:10pt;font-weight:bold;co lor:#000000;""
width=""650"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & _
"" & _
"" & _
"" & _
"" & _
"" & _
"" & _
"
First Name:
size=""29"" value=""" & Request("Fname") & """ readonly
tabindex=""1"">
Last Name: align=""left""> name=""lname"" size=""29"" value=""" & Request("lname") & """ readonly
tabindex=""2"">
Company:
size=""29"" value=""" & Request("company") & """ readonly
tabindex=""3"">
Business
Title:
id=""co_title"" name=""co_title"" size=""29"" value=""" & Request("co_title")
& """ readonly tabindex=""4"">
Address:
size=""29"" value=""" & Request("address1") & """ readonly
tabindex=""5"">
Address Cont.: align=""left""> name=""address2"" size=""29"" value=""" & Request("address2") & """ readonly
tabindex=""6"">
City:
value=""" & Request("city") & """ readonly tabindex=""7"">
align=""left"" width=""100""> State: class=""TextBox"" type=""text"" id=""state"" name=""state"" size=""29""
value=""" & Request("state") & """ readonly tabindex=""7"">
Zip: class=""TextBox"" type=""text"" id=""zip"" name=""zip"" size=""29"" value="""
& Request("zip") & """ readonly tabindex=""9"">
width=""100""> Phone: type=""text"" id=""phone"" name=""phone"" size=""29"" value=""" &
Request("phone") & """ readonly tabindex=""10"">
Fax: class=""TextBox"" type=""text"" id=""fax"" name=""fax"" size=""29"" value="""
& Request("fax") & """ readonly tabindex=""11"">
width=""100""> Email: type=""text"" id=""email"" name=""email"" size=""29"" value=""" &
Request("email") & """ readonly tabindex=""12"">
" & _
" Style=""font-family:Arial;font-size:10pt;font-weight:bold;co lor:#000000;""
width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & _
"" & _
"
Comments: align=""left"">
" & _
"

************************************************************ ***********************" & _
"


Message Sent On: " & Now() & ""

msgMail.Send
Set msgMail=nothing


ALSO TRIED:
"

border=""0"" cellpadding=""0"" cellspacing=""0"">" & _


Is there something I am missing or Is there an easier way to do this?

Thanks Much In Advance,
R

Re: Emailing Form Results in HTML

am 11.07.2007 14:20:24 von Daniel Crichton

Rob wrote on Tue, 10 Jul 2007 10:16:02 -0700:

> Hi,
>
> I have a form (it works fine) but what I want to do is email the form
> exactly as it is with the populated information. In otherwords, I want the
> email sent to look just like the form that was filled out. I was able to
> get it close but the problem I am having is that the form has a table in
> it and the table uses a background JPG; but for some reason image is not
> being included in the email and I'm stumped as to how to get it in there
> where it belongs.
>
> Here's the code I am using in the email function/sub.....
>
> CODE:
>
> & _ " > style="background-image:url('table_background.jpg');backgrou nd-repeat:no-r
> epeat;font-family:Arial;font-size:10pt;font-weight:bold;colo r:#000000;"

> ALSO TRIED:
> "

> border=""0"" cellpadding=""0"" cellspacing=""0"">" & _
>
> Is there something I am missing or Is there an easier way to do this?
>

Change the above to have the full URL to the table_background.jpg image to
load from your site, eg. http://www.yoursite.com/table_background.jpg.

If you want to actually embed the image then this might help:

http://classicasp.aspfaq.com/email/how-do-i-send-e-mail-in-h tml-format.html

Scroll down to the bit title "Embedding images in the e-mail". However this
will likely only work with Microsoft Outlook/Outlook Express. There are
likely ways to manage it to work with all HTML capable browsers, but I've
not used CDO myself. Personally I use Persits ASPEmail
(http://www.aspemail.com), it's fairly easy to create HTML with inline
images using this.

Dan