Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

How do I send an email from a form using CDOSYS?

I have a basic online form which I am trying to send email from. I can get it to work up to a certain point. My issue is with the body. The way I currently have it set up it only sends the last value processed which in this case is the "question" field. How do I put all of my form fields in an email? It doesn't have to be pretty so text format is fine. If HTML is easier than I can go that route to.
<%@ LANGUAGE="VBSCRIPT" %>    
<% response.buffer="true"%>
 
 
 
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Web Lead from JohnBartz.com"
myMail.From= Request.Form("Email")
myMail.To="dan@johnXXXXXX.com"
myMail.Cc="XXXXXXXX@gmail.com"
myMail.TextBody= "From: " & Trim(Request.Form("name"))& VBCrLf
myMail.TextBody= "Email Address: " & Trim(Request.Form("Email"))& VBCrLf
myMail.TextBody= "Company: " & Trim(Request.Form("company"))& VBCrLf
myMail.TextBody= "Phone: " & Trim(Request.Form("phone"))& VBCrLf
myMail.TextBody= "Question: " & Trim(Request.Form("question"))
myMail.Send
set myMail=nothing
Response.redirect "inquiry-thanks.html"
%>

Open in new window

0
futr_vision
Asked:
futr_vision
  • 3
  • 2
1 Solution
 
Wayne BarronCommented:
see if this works for you

Carrzkiss
<%@ LANGUAGE="VBSCRIPT" %>    
<% response.buffer="true"%>
 
 
 
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Web Lead from JohnBartz.com"
myMail.From= Request.Form("Email")
myMail.To="dan@johnXXXXXX.com"
myMail.Cc="XXXXXXXXXXX@gmail.com"
myMail.TextBody= "From: " & Trim(Request.Form("name"))& VBCrLf
myMail.TextBody= myMail.TextBody &  "Email Address: " & Trim(Request.Form("Email"))& VBCrLf
myMail.TextBody= myMail.TextBody &  "Company: " & Trim(Request.Form("company"))& VBCrLf
myMail.TextBody= myMail.TextBody &  "Phone: " & Trim(Request.Form("phone"))& VBCrLf
myMail.TextBody= myMail.TextBody &  "Question: " & Trim(Request.Form("question"))
myMail.Send
set myMail=nothing
Response.redirect "inquiry-thanks.html"
%>

Open in new window

0
 
Wayne BarronCommented:
I did not catch on to that, And have asked the mods to come in and remove
Your personal information from the post.
Should be taken care of shortly, they are usually pretty quick, as long as they
Are not all 4th of July out.. :)

Have a good one.
Carrzkiss
0
 
futr_visionAuthor Commented:
Thanks. One that is done I'll award the points.
0
 
futr_visionAuthor Commented:
Thanks a bunch for a quick and complete answer.
0
 
Wayne BarronCommented:
You are very welcome.
Have a great evening.

Carrzkiss
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now