| | |
CDOSYS Form to Email Formatting
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2006
Posts: 5
Reputation:
Solved Threads: 0
Hi there,
I'm new to the forums and a programming novice.
I've set up a CDOSYS form to email (a newsletter sign-up) and I'm trying to get my form field data to display on separate lines after the form has been processed - like the following:
Name: [value]
Company: [value]
Email: [value]
Subscribe: [value]
Unsubscribe: [value]
Here's the piece of the code I'm having trouble with:
with oCdoMail
.Subject = "Newsletter Request"
.TextBody = Name: Request.Form("Name") & vbCrLf & "
Company: & Request.Form("Company") & vbCrLf & "
Email: & Request.Form("Email") & vbCrLf & "
Subscribe: & Request.Form("Subscribe") & vbCrLf & "
Unsubscribe: & Request.Form("Unsubscribe")
end with
Any help is greatly, greatly appreciated. I'm going nuts (easy to do as a non-programmer).
gilroda
I'm new to the forums and a programming novice.
I've set up a CDOSYS form to email (a newsletter sign-up) and I'm trying to get my form field data to display on separate lines after the form has been processed - like the following:
Name: [value]
Company: [value]
Email: [value]
Subscribe: [value]
Unsubscribe: [value]
Here's the piece of the code I'm having trouble with:
with oCdoMail
.Subject = "Newsletter Request"
.TextBody = Name: Request.Form("Name") & vbCrLf & "
Company: & Request.Form("Company") & vbCrLf & "
Email: & Request.Form("Email") & vbCrLf & "
Subscribe: & Request.Form("Subscribe") & vbCrLf & "
Unsubscribe: & Request.Form("Unsubscribe")
end with
Any help is greatly, greatly appreciated. I'm going nuts (easy to do as a non-programmer).
gilroda
•
•
Join Date: Jun 2006
Posts: 5
Reputation:
Solved Threads: 0
I figured it out. Here's the working code:
with oCdoMail
.Subject = "Newsletter Request"
.TextBody = "Name: " & request.form("Name") & vbcrlf & "Company: " & request.form("Company") & vbcrlf & "Email: " & request.form("Email") & vbcrlf & "Subscribe: " & request.form("Subscribe") & vbcrlf & "Unsubscribe: " & request.form("Unsubscribe")
end with
with oCdoMail
.Subject = "Newsletter Request"
.TextBody = "Name: " & request.form("Name") & vbcrlf & "Company: " & request.form("Company") & vbcrlf & "Email: " & request.form("Email") & vbcrlf & "Subscribe: " & request.form("Subscribe") & vbcrlf & "Unsubscribe: " & request.form("Unsubscribe")
end with
•
•
Join Date: Sep 2004
Posts: 89
Reputation:
Solved Threads: 1
Store all the values in a variable and then show them on the page. This would be easy to use and update at later stages.
•
•
Join Date: Dec 2007
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
I figured it out. Here's the working code:
with oCdoMail
.Subject = "Newsletter Request"
.TextBody = "Name: " & request.form("Name") & vbcrlf & "Company: " & request.form("Company") & vbcrlf & "Email: " & request.form("Email") & vbcrlf & "Subscribe: " & request.form("Subscribe") & vbcrlf & "Unsubscribe: " & request.form("Unsubscribe")
end with
Hi,
this works great, but any ideas how to change the colour of the text such as changing "Name: " so it appears up in orange in the email sent.
Thanks, Matt
![]() |
Similar Threads
- setting up an automatic email reply from a form. (Site Layout and Usability)
- Form to email in dreamweaver 8 (HTML and CSS)
- cdoMessage.To=Request.Form("email") (ASP)
- cdo using combo box in my form (ASP)
- form-to-email in Dreamweaver (Community Introductions)
- creating Contact form to email and txt file (PHP)
- Sending form email (PHP)
Other Threads in the ASP Forum
- Previous Thread: ASP XML - Help Needed ?
- Next Thread: how to export results from form as txt file
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





