CDO Question -- Generating Email Messages In HTML Format
CDO is perhaps the most obscure art in web programming, but I hope someone would understand my issue. I have an ASP web application that needs to send email messages in HTML format only -- there is no plain text version. The messages are summaries of answers that people have input into an online survey, and need to have a tabular form.
The following somewhat plausible code does not work:
dim OMsg Set OMsg = Server.CreateObject("CDO.Message") OMsg.Fields("urn:schemas:mailheader:return-path") = BounceEmail OMsg.Fields("urn:schemas:mailheader:content-type") = "text/html" OMsg.Fields.Update
The return path header is set as desired, but the content type header stubbornly defaults to "text/plain". What is the secret to setting that header?
I have seen lots of code examples on the MSDN site for setting the content-type of body parts, but it seems needlessly complicated for my situation and doesn't work on my system anyhow (unknown ProgID error). So I was hoping to just set the message-level header to "text/html". (If I edit one of the messages from my script in notepad, changing the header to text/html by hand, it then is rendered correctly in email clients.)
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Generating Email Address And Textarea To Be Inlcluded On Email
1. I want users to type in their email address on a textfield, and after users press the "Submit" button. The info will automatically go to another person's email to receive a compliment, suggestion, etcetera. 2. Another is how to include the message written on a textarea of a form with the ASP code supplied below: Code:
Generating HTML Reports
I want to generate HTML based reports with ASP. But the problem which i m having is to controll the Paging operation while printing the reports. Unlike the Professional reports softwares as Crystal Reports and Also the Data Reports of visual basic (which are controlling the Paging automatically), a mannually generated HTML based reports need some logic to perform paging operation while printing.
Sending (text Or Html Version) Messages Using JMail
I have that form that send email to subscribers. Even if the specified option is set to "TEXT" I still see the HTML coding in the message... Tho when I look the source of the message I see "X-Mailer: JMail 4.5 by Dimac Content-type: text/plain; charset=iso-8859-1: and all the <br> code are that way : <br=3E my jmail code:
Mail Content-type And Messages In One Email ASPMailCtrl.1
What I want to do, is to be able to send only one email with tow header text/plain and text/html with two different messages I was able to do it only to send two email with different content-type and messages, but I would like it to send only one email with two content-type headers and two messages ...
Generating A Secure Email....
On our website, a user can order products from us. When they "submit" the order, the website designer has written some ASP code to auto send an email to our Exchagne 2000 server. Due to the contents of the email, we need to secure it... How can we send a "secured" email from ASp script or would this not be a function of ASp at all but the server the email is being sent from? There must be something in the ASP code to indicate the email needs to be secured?
Html Format
can anybody help me out?what i need to do is -- upload a .doc file to an html format so that the formatted text is not changed.
HTML Format Emails
I have an application which sends out emails in HTML format. I have a problem when I am trying to display images in the email (name of the image file is taken from database). The problem is that if there is a space in the image file name, it displays a + (PLUS sign) and does not display the photo in GMAIL and other emails. The URL of the image gets displayed in the following manner: 3_Marathon+Crescent_Toronto_1.jpg+ How do I solve this + (PLUS sign) issue?
Sending Emails In Html Format
I am trying to send an email from an asp page in html format unfortunately when parenthese appear in the HTML code of the page to be emailed the ASP page reads them and trys to interpret them as ASP code <div align="center"> any suggestions?
Write From An Html Form To Csv Format
I created a web form in html, I need to create a server-side script using ASP and embed it into the html, so that when the user clicks submit, it sends(saves) the data from text boxes, drop-downs etc, to a text(.txt) file on the server. It needs to be in csv format so that they can create an excel file from it.
Send E-mail In HTML Format
If i want to send an email in HTML format, do i just set the bodyFormat to 1 or it's much more complicated? any examples available?
Displaying Image Using The Mailer Object In HTML Format
The code sends an automatic email, but the email is html format. At the top of the email i want to include an image. Everything is working except the image is not being included, instead a box with a X appears. Here is the code that i am currently using Dim htmlMess ' THIS STORES THE HTML CODE PHP Code:
Form Processing Script: Results In HTML Mail Format?
I have purchased a form processing script, which basically saves the data into a database, emails certain people's email addresses with the form results, and also sends an email to the user that filled in the form with a thank you email. However, all the emails are being sent in plain text format. I would like to change this to HTML so I can make the results look nicer and also make the thank you email look nicer. I have emailed the script developers, but have yet had a response from them, so i thought id put a post on here! I have found the part of the coding that sends the Thank You email out to the user once they have filled in the form: '/// Send Autoresponse if replyto<>"" and (autoresponse<>"" or sendcopy<>"") then if sendcopy<>"" then autoresponse=autoresponse & vbcrlf & vbcrlf & message call sendmail(replyto,mailadmin,formname,autoresponse) end if end if .......
Format Email Form Results
Code: Mail.Subject = "Website - Account" strEmailText = strEmailText & "Company Name: " & Request.Form("compname") & vbCrLf strEmailText = strEmailText & "Company Address: " & Request.Form("compadd") & vbCrLf strEmailText = strEmailText & "Business Nature: " & Request.Form("businessnature") & vbCrLf i would just like to know how i can add bold/underline and line breaks in this email because at the moment it just displays the email like this.. this: this thing this: this thing... etc
Checking Email Address Format
Is there a way to check if an email address is the right format, e.g: firstname.secondname@myserver.com.I want to check that every email address entered has a firstname then a . then a second name and always @myserver.com
Html Email
I dont have CDONTS support. i am using the following script. with this, even yahoo doesn't consider the email to be HTML and displays all the HTML tags and treats it as TEXT. here is the code i use! Please dont consider it abuse as i dont know how to encloase the code in TAGS! <% mes = "" IsSuccess = false sTo = Trim(Request.Form("txtTo")) sFrom = Trim(Request.Form("txtFrom")) sSubject = Trim(Request.Form("txtSubject")) sMailServer = "127.0.0.1" sBody = Trim(Request.Form("txtBody")) if Request("__action")="TestEMail" then TestEMail() end if Sub TestEMail() Set objMail = Server.CreateObject("CDO.Message") Set objConf = Server.CreateObject("CDO.Configuration") Set objFields = objConf.Fields With objFields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sMailServer .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With With objMail Set .Configuration = objConf .From = sFrom .To = sTo .Subject = sSubject .TextBody = sBody End With Err.Clear on error resume next objMail.Send if len(Err.Description) = 0 then mes = " Message sent to " + sTo mes = mes + " EMAIL SENT SUCCESSFULLY!" IsSuccess = true else mes = " " + Err.Description + " TESTS FAILED!" end if Set objFields = Nothing Set objConf = Nothing Set objMail = Nothing End sub Sub Alert(html) if IsSuccess then Response.Write "<div class='testRelults' id='testSuccessful'><span class='testResult'>Success:</span>" & html & "</div>" else Response.Write "<div class='testRelults' id='testFailed'><span class='testResult'>Fail:</span>" & html & "</div>" end if End Sub %>
HTML Email
I'm sending email using CDO Message in HTML Formatted. There is no problem if client side is HTML Enable. But if it doesnt not, its showing all html tags in message body. How can I solve this?
HTML Email Css
I've got another email prob. Does anyone know how to link an external stylesheet in an html email via asp? I've got this so far: While NOT offerCustRS.EOF Dim strBody strBody = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" strBody = strBody & "<html>" strBody = strBody & "<head>" strBody = strBody & "<title></title>" strBody = strBody & "<meta http-equiv=Content-Type content=""text/html; charset=iso-8859-1"">" strBody = strBody & "<link rel=""stylesheet"" href=""CSS/blue.css"" type=""text/css"">" strBody = strBody & "</head>" strBody = strBody & "<body>" strBody = strBody & "<div id=""head"">Special Offers from the best online shop</div>" strBody = strBody & "<p>" strBody = strBody & "<div id=""content"">" while not offerRS.EOF strBody = strBody & "Product:" & " " & "<a href='http://localhost/New Shop/products.asp?id=" & offerRS("Product_ID") & "'>" & offerRS("Product_Name") & "</a><br>" strBody = strBody & "Price:" & " " & offerRS("Offer_Price") & "<br>" strBody = strBody & "</div>" offerRS.MoveNext() WEND strBody = strBody & "</body>" strBody = strBody & "</html>" The email doesn't have any of the formatting but I haven't a clue why. The css file has been tested on another page and it works so the css is fine. Can anyone help?
Html -> Asp Email
I have created a form in html that goes to an email which will supply the person with all contact info. So I need Two things to make this work: 1.) HTML page with email form and submit button (done) 2.) ASP page with code that validates all the info and mails the info to the persons email (dont have) SO, I need some type of code that will validate this html document. Any Ideas ?
Sending HTML Email
I have a client that wants to send HTML based email. Building and sending isn't a problem, but he wants to include a plain text link at the top of the email that will display if the user doesn't not accept HTML email. Maybe it is the product we are using to send the email, but there is no way to include non-HTML formatted text in the email. Is there a way to send non-HTML and HTML in a single email?
Truncated Html Email
I am creating both a text and html version of the same newsletter and sending using CDOSYS. Both of them incorporate a list of stories drawn from a database which are assigned to a variable storyloop. The text version works fine, but partway throught the html version when viewed in Outlook 2000, it goes wrong. View source shows nothing obviously wrong, except that partway through the storyloop, it just stops and then goes onto the next section on the email. Outputting storyloop to the browser gives perfect results, but if I remove all parts of the html email and just assign storyloop to the .htmlbody, I see that after exactly 1024 characters in the resulting email, I get ------ =_NextPart_000_0057_01C59E01.6E3F5F50-- Does anyone know why this would happen, and more importantly, what I can do to correct it?
Sending HTML Email
I'm trying to send an HTML page as an email (to an HTML-enabled mail app), is this just an extension of the 'mailto:' <a> tag? any help would be great.
Attach HTML Email
Is it possible to send an HTML email through CDONTS without formatting it into one big long string?
HTML And TEXT Email Using ASP
Need help with sending HTML and Text email from ASP page. I want to specify both and depending on the receivers email reader the apropriate one should show. Any help or pointing to a source for MULTIPART MIME type is going to be greatly apreciated.
Appearing In HTML Email Set
I support a website. When we send HTML emails from out system, we generate a variable called "str". We set that str variable to the objMail.htmlbody property of the mail object. Frequently, random spaces appear in the email when it is received by the recipient, however those spaces do not always appear in the same place (yet frequently they do). additionally, we'll sometimes see some actual HTML code in the final email, and usually shows up as a complete tab, such as "<br>", or "< TD BGCOLOR='#FFFBF0'>".
Checkboxes And Dropmenus In HTML Email
I am trying to finish some ASP code for a webform of mine that takes values input into a form and upon hiting the submit button, emails the form in HTML format with all completed values in their respective boxes to the recipient specified. So far I've gotten the text box values to carry through using a line such as this: <input name=""date2.3"" type=""text"" id=""date2.3"" value="""& Request.Form("date2.3")& """ size=""2"" maxlength=""2"">" However, I cannot get checkbox values or dropmenu values to carry through to the resulting email. What do I need to do differently with Request.form to get it to send the checkbox and dropmenu items in the e-mail?
Creating An HTML Email Body
I have a rather large form in HTML that needs to be sent as an email. The body of the email is approx. 400 lines (that's in HTML). Is it possible to somehow transfer the entire form to the asp mail script so that it automatically sets the body of the email to contain this form (with input)? Or do I have to write the body by hand in my asp script - like this: line 001 Body = "<table><tr><td>some text & var1 & </td></tr> " ... .. line 200 Body = Body & "</table>"
HTML EMail Form CDonts
How to I wrap this to process the information as HTML EMail? I have enabled all the HTML options in the script but I still get a text email:....
Form Submit From An HTML Email
I'm working on an email message sent in HTML format. As the email reach the adressee the HTML is correctly visualizaed (I made sever tests with Outlook 2003). The fact is that the code contains a <formthat should be submitted to an external ASP page. The <formtag naturally cointains a target=_blank and a proper action. Anyway it semms to be impossible to make the form work. The submit does not work; it is evidently an Outlook permission matter... I verified that sever other things such as <iframes and Javascript code do not work at all when an HTML is visualized in Outlook. Is there a way, in your knowledge to go round the problem?
Why Are My HTML Tage Showing In EMAIL?
When I send this code (using CDONTS) I had expected just the title to appear on the email but ALL of the text - including the HTML tags are coming though. Do I need a line setting something to HTML so it knows it's HTML? Any ideas??? CODE IN QUESTION: Body= Body & "<HTML>" Body = Body & "<HEAD>" Body = Body & "<TITLE>Send Mail with HTML</TITLE>" Body = Body & "</HEAD>" Body = Body & "<BODY bgcolor=""lightyellow"">" RESULTING EMAIL: <HTML><HEAD><TITLE>Send Mail with HTML</TITLE></HEAD><BODY bgcolor="lightyellow">
Sending Dynamic Html Email
I am currently building an emailing system into our asp management system. From this we will be able to setup mail templates (html stored in mssql database) and select who we want to send them to.The html in the database is only the middle part of the html file being sent. All the emails are based on the same design template using a single html file to which I pass a variable saying which body to get from the database <%=writeBody%>. So far this is all working fine and the emails are sending using cdo. ..createMHTMLBody "http://localhost/helpCentric/responseSendForm.asp?"&qString What i am trying to do now is personalise the emails and on the responseSendForm.asp I connect to the database and create variables such as fName, lName etc.I need to be able to write these variables in the html in the database which will then display in the body using the <%=writeBody%>.As you may have guess this is not working and I dont know enough aboutthe .createMHTMLBody to work out what to do.
Creating HTML EMail With CDONTS
I can create an email with ASP's using CDONTS and this works well. I'd like to format the email as HTML. Can I do this with ASP's and CDONTS?
Creating And Sending Html Email
i have a web site built using vbasic active server scripting running on iis (it works on either iis 50 and 60, but is designed for iis 50). i know how to create a plain text email by creating a text file, with content following certain format, and saving that file into the correct '..mailrootpickup' folder, and it is working fine. what i would like to know is how to create and send an email in html format from my server script. i will appreciate anyone who can tell me where to find instructions on how to do this.
Sending Launching Email With HTML Attachment
Can anyone get me started or point me to a resource for some help? I have an ASP page that displays various boxes, tables, and information. I want to be able to click an "Email" button and have the asp page save the page as an attachment (html?) and then launch Outlook and automatically attach the page to it and enter the email address of the person I want to send it to. I can't just send a link because the page is generated on an Intranet and I need to send it to people outside the network. So, I need to save a print screen of the page and then have Outlook grab that and the recipient's email address and put those into Outlook so the sender can review and send out.
How? Send Same Email As HTML *or* Plain Text
I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the DB as formatted HTML so ASP just drops them right into a page shell. Now, we want to send out a newsletter email containing some of those items. No problem sending as HTML. However, some of the members want just plain text. Is there some magic method in CDO that can automatically convert HTML to plain text? Or, is there some existing VBScript code out there that can do this? BTW, the environment is IIS 5.x (Windows 2000), Classic ASP, and CDO.
Embed Image Within HTML Email (CDO Or CDONTS)
Usually, when I send HTML emails, I just SRC the image to my web server, but now I would like to consider embedding images for those instances when potential customers may view the email when offline. Can this be done with CDO or is another component required?
Need Help Sending CDO Email With Dynamic HTML Attachment
I'm using CDO SYS to send email messages. I can attach a file just fine. However, I need to attach an HTML page that's generated on the fly by my ASP code. The attachment source code gets assembled into a VB string. How do I attach this? I think there was an easy way in CDONTS but that's no longer an option.
Send Html Email With Form Included
I been trying to send a Html email with a form included. I tryed by including <form> and <input> as usual in Html code. What happen is that the email is send and the form are seen but the input button doesnt work right, in hotmail , msn, I mean its not active Any idea?
Formatting HTML Email From Form Submission?
All of my previous web page work has been done with .html and Cold Fusion. My new host does not support cold fusion but does have ASP 3.0 and ASP.Net 1.1. They've told me that I have to use CDO.Sys for sending email. I've spent the past 3 days doing all the research I can find but most of the examples assume a basic knowledge of ASP (which I am severly lacking in). I have a simple .html form (4 fields) that currently DOES get sent through email (although it is sent as plain text). I would like to be able to send an email that is formatted into html (allowing me to use tables, images, etc. Here is what I have so far (I've commented out the "text" based part and am trying to send as an html email now). <% @ Language="VBscript" %> <% Option Explicit %> .....
Send Html With Embedded Image Email In Asp
I want to send email in html format with containing more images added dynamically using cdo.message method. can you pls explain any body one how to do this. i alredy done this, but it send only one picture with that email. here i posted my code also. pls any one tell me what is the problem in this code. theSchema="http://schemas.microsoft.com/cdo/configuration/" Set cdoConfig = server.CreateObject("CDO.Configuration") cdoConfig.Fields.Item(theSchema & "sendusing")= 2 cdoConfig.Fields.Item(theSchema & "smtpserver")= "smtp server" cdoConfig.Fields.Update Set mail = Server.CreateObject("CDO.Message") html = "<html>" html = html & "<head>" html = html & "<meta http-equiv=""Content-Type""" html = html & "content=""text/html; charset=iso-8859-1"">" html = html & "</head>" html = html & "<body>" html = html & "<p><font face=""Arial"" ><b>Name: " & name & "</b></font></p>" html = html & "<p><font face=""Arial""><b>Company Name: " & cname & "</b></font></p>" html = html & "<p><font face=""Arial""><b>Country: " & ctry & "</b></font></p>" html = html & "<p><font face=""Arial""><b>E-mail: " & email & "</b></font></p>" html = html & "<p><font face=""Arial""><b>Details: " & remarks & "</b></font></p>" html = html & "<p> </p>" for i = 0 to ubound(iid) html = html & "<img border=""0"" src=""" & "http://www.abcd.com/img/" & fnme(i) & """></td>" next html = html & "</body>" html = html & "</html>" mail.From= emailFrom mail.Configuration=cdoConfig mail.To = emailTo mail.Subject = emailSubject mail.HTMLBody = html mail.Send set mail = nothing set cdoConfig = nothing
HTML Email Can't Be Read As Plain Text??
I'm using the ASPEmail component to send HTML email newsletters: Mail.Host = "mail.myserver.co.uk" Mail.From = strFrom Mail.FromName = strFromName Mail.AddAddress strTo, strName_In Mail.Subject = strSubject Mail.Body = strMessage Mail.AltBody = "PLAIN TEXT VERSION" Mail.isHTML = True Mail.SendToQueue The emails are coming through fine, though in Outlook the option to 'View as Plain Text' is greyed-out. This should let the user see the plain text version as defined in the code above, but it is inactive.
Email The Same Html Page As Attachment After Submission
I have designed a form after submission of which an email is sent to a perticular e-mail id. Up to this it works fine but I need to send a complete filled html page in attachment too. Can this be possible. If any way to do this please let me know. As mail sender am using CDO.
Sending CDONTS HTML Email Issue
I have a web form where a client can select which site members to send an email to. This form is populated from the contents of the member table, so the form can have 0-x names listed on it depending on member expiration dates. When the form is submitted, the code loops through the form contents and sends an email to those members that meet the selected criteria. All this worked perfectly when I was sending text emails, but since I changed, it sends the message correctly, but the last person gets everyone else as well. For example, if I have three members (mem1, mem2 and mem3) to send emails to, here is what happens mem1 gets the correctly formatted message mem2 gets mem1's correctly formatted message plus mem2's message - one right after the other. Code:
CDONT And HTML Email Line Wrap Problem
I send HTML formatted emails with links and images in them generated by my asp driven website. Occasionally the image will not appear and the link will not work. By looking at the email at the receive end, (right click/properties/details/message source, this is what I sent: .....
Multipart Mime Type For HTML/Text Email
How to send the HTML and Text email at the same time? CDONTS only send one type of email at one time and we should know before hand what type of email the client can receive. In my case i want to send both and depending on clients email reader the right one should show up. I have used ASP email component also but for this component to work properly we should have relaying enabled on our SMTP server. Due to the threats of SPAM i dont want to do this. I am not any demanding here but simply trying to find the better way.
Making A Query Show Up Properly In A HTML String Email
I am attempting to send an HTML email which a hyperlink that will change based on the user's session ID. I need the hyperlink to display as: http://www.synergeticsusa.net/admin/shop_cart/detail.asp?id= WHERE the id = Session("MM_UserID") However I cannot seem to code this into the html string in the correct syntax, to where id=1 or id=2, etc. Does anyone know the anwser to this problem?The basic code I am using can be found below. html = html & "<a href=""http://www.synergeticsusa.net/admin/shop_cart/detail.asp?id="">" html = html & Session("MM_UserID") html = html & "<IMG SRC=""myImage2.gif""></A><BR><BR>" html = html & "</br>"
|