Forum Moderators: phranque

Message Too Old, No Replies

using script to send .html e-mail

         

stcrim

4:54 pm on Dec 13, 2000 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a script that sends e-mails at pre-set times. Right now we use it to do a site survey. It goes out as a text based survey and the visitor must hit reply to answer the survey.

We would like to make the survey in .html and use form elements. Have made several - but when I put the html code onto the text file (template) being sent, the results are, the receiver gets an e-mail full of code rather that a nice html coded e-mail. When I send the same email from one of my accounts in outlook to another it works just fine.

Does anybody have any idea how I can get the .html to work properly when being sent as a text template from a script?

DaveAtIFG

5:42 pm on Dec 13, 2000 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't think you can insure it displays as HTML since it depends on the recipients email client. For example, I use both NS 4.76 and Eudora to handle email and have the preferences/options set to display everything I receive as plain text. An email full of HTML codes normally goes directly into the trash, it's usually spam.

stcrim

6:48 pm on Dec 13, 2000 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dave,

The problem is, it won't display for those who do have mail clients that display .HTML

any other thoughts???

DaveAtIFG

7:18 pm on Dec 13, 2000 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Steve - I wouldn't be digging through my trash can for just anybody! ;) Your response got me remembering that occasional spam DOES disply HTML in spite of my preferences settings.

So I dug a few up. I suspect the headers may have some influence in this area and included what may control how it's displayed. I'm not very sharp in this area, Brett is. Email headers I found that always displays HTML:

MIME-Version: 1.0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I found several examples all using these same header values, one included a form with drop downs et al similar to what you desribed.

Gotta go wash my hands... :)

stcrim

8:36 pm on Dec 13, 2000 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks Dave - I will play with it and see if I can get something working...

stcrim

11:02 pm on Dec 13, 2000 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Getting closer: (read below too)

Errors: errors@mydoman.com
To: [e_email]
bcc: me@myisp.net
From: me@myisp.com
Subject: [name], about your service at Findlay...
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="filename.html"
Content-Base: [mydomain.com...]

This header make the html work, but brings it in as an attachement. The form works but does not roll over to the second page as it doe if I do this purely in outlook express

Is there anything I should put in the header to make this function as a pure html page???

stcrim

4:02 am on Dec 14, 2000 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This worked:

MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
Content-Base:http://www.mysite.com

Fusioneer

11:37 pm on Jan 10, 2001 (gmt 0)

10+ Year Member



You can send multi-part messages so plain text clients can get a plain text message, eg. "Please visit this URL to complete the survey".The HTML clients will not see the plain text message at all and will just get the HTML.

I have a CF custom tag that collects input from a form and formats an email both in plain text and HTML (with all form fields and user input in small Arial - great for big forms. It also means you don't have to mess around with naming each field as the script loops through all input fields and gathers them for output.

Anyway multi-part emails look like this:

From: server@domain.com
To: user@home.com
Subject: CFMAIL test
Reply-To: server@domain.com
Date: 05 Jan 2001 20:27:42 -0500
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_Kw33Bs99~WRRhysyY"
Message-Id: <200101051749356.SM02656@ddfllml01.domain.com>
X-RCPT-TO: <user@home.com>
X-UIDL: 269925326
Status: U

------=_Kw33Bs99~WRRhysyY
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Text message here.

------=_Kw33Bs99~WRRhysyY
Content-Type: text/html

<HTML>
<HEAD>
<TITLE>CFMAIL Test</TITLE>
</HEAD>
<BODY>

<h1>HTML message here</h2>

</BODY>

------=_Kw33Bs99~WRRhysyY--

kahunaa

2:37 am on Mar 6, 2001 (gmt 0)



I'm trying to get this to work and could use some help.

Could someone send me a sample html page with setup to send HTML and fall back to plain text.

b@iparq.com

Thanks

kahunaa

9:00 pm on Mar 6, 2001 (gmt 0)



more specifically,

I'm trying to get CFMAIL to send a multipart plaintext & html email message.

any help here would be great!!

DaveAtIFG

5:42 am on Mar 7, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



kahunaa - Welcome! We're not ignoring you! I was waiting, hoping someone would jump in and be able to answer your questions. Let me suggest a Stickymail to Fusioneer. S-Mail is an "on the board" e-mail system from user to user. When you're logged in you will see:
"Welcome kahunnaa:
signout, profile, show cookies, flags, StickyMail
site search, glossary, help, about, privacy policy, disclaimer, login, recent posts"
at the top of your screen. Fusioneer is a regular here, knowledgeable and helpful, and since he seems familiar with CFMail...