Re: [PHP] HTML Email Composing Problem.

2007-07-29 Thread Chris

Tom Ray [Lists] wrote:

Chris wrote:

Richard Lynch wrote:

On Thu, July 26, 2007 2:46 pm, Tom Ray [Lists] wrote:

I'm trying to use PHP to compose an HTML formatted email


Don't do that...


3) Spam Assassin doesn't like it either way and tags the email as SPAM
for the following reasons:

 0.6 HTML_SHORT_LENGTH  BODY: HTML is extremely short
 0.0 HTML_MESSAGE   BODY: HTML included in message
 1.5 MIME_BASE64_TEXT   RAW: Message text disguised using base64
encoding


snip

However, I would still like to get answers on questions 1 and 2 for 
future reference so any thoughts would be great.


They're pretty self explanatory.

1) Make your message longer
2) Your message contains html. Your rules are set up to flag anything 
with html as spam.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HTML Email Composing Problem.

2007-07-27 Thread Chris

Richard Lynch wrote:

On Thu, July 26, 2007 2:46 pm, Tom Ray [Lists] wrote:

I'm trying to use PHP to compose an HTML formatted email


Don't do that...


3) Spam Assassin doesn't like it either way and tags the email as SPAM
for the following reasons:

 0.6 HTML_SHORT_LENGTH  BODY: HTML is extremely short
 0.0 HTML_MESSAGE   BODY: HTML included in message
 1.5 MIME_BASE64_TEXT   RAW: Message text disguised using base64
encoding


The only people who send out these stupid HTML enhanced (cough, cough)
messages are spammers.


Pfft. There are tons of legitimate reasons to send html emails.


To get rid of the last one, don't base_64 encode your html content.

You only need to base64_encode embedded images or attachments (pdf's, 
docs, stuff like that).


As someone else suggested, check out phpmailer - it handles all this for 
you and works pretty nicely.


--
Postgresql  php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HTML Email Composing Problem.

2007-07-27 Thread Richard Heyes

  0.6 HTML_SHORT_LENGTH  BODY: HTML is extremely short

Well, lengthen it then.

1.5 MIME_BASE64_TEXT   RAW: Message text disguised using base64 
encoding


Don't do that. Use plain text or quoted printable.


Any help/suggestions would be appreciated.


Try HTML MIME mail - it does every thing for you:

http://www.phpguru.org/static/htmlMimeMail5.html

--
Richard Heyes
+44 (0)844 801 1072
http://www.websupportsolutions.co.uk

Knowledge Base and HelpDesk software
that can cut the cost of online support

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HTML Email Composing Problem.

2007-07-27 Thread Tom Ray [Lists]

Chris wrote:

Richard Lynch wrote:

On Thu, July 26, 2007 2:46 pm, Tom Ray [Lists] wrote:

I'm trying to use PHP to compose an HTML formatted email


Don't do that...


3) Spam Assassin doesn't like it either way and tags the email as SPAM
for the following reasons:

 0.6 HTML_SHORT_LENGTH  BODY: HTML is extremely short
 0.0 HTML_MESSAGE   BODY: HTML included in message
 1.5 MIME_BASE64_TEXT   RAW: Message text disguised using base64
encoding


The only people who send out these stupid HTML enhanced (cough, cough)
messages are spammers.


Pfft. There are tons of legitimate reasons to send html emails.


To get rid of the last one, don't base_64 encode your html content.

You only need to base64_encode embedded images or attachments (pdf's, 
docs, stuff like that).


As someone else suggested, check out phpmailer - it handles all this 
for you and works pretty nicely.


I would have to agree with you Chris, there a many legitimate reasons 
for having HTML mail. I was trying to be a nice guy and send both the 
plain text version and the html version out but like I said, I couldn't 
get it to stop displaying both. I dumped the base_64 encoding already 
and also gave up on trying to do a multipart/mixed with both plain text 
and html and am just composing them as plain text or html as needed. 
PHPMailer is great for a resource but this is a customized project and 
PHPMailer won't fit in it. Plus I really would like to have this 
knowledge rattlin' around in my head anyways.


It all works with Yahoo, Gmail and Hotmail. It displays properly and 
isn't shoved into the Junk/Spam folders. Everything displays right in 
Thunderbird and Outlook Express and the only time it's flagged as spam 
is if it goes through my main account which, in reality, has a insanely 
low score base (.5) and it's now scoring a .6 so I think I've got a 
solution.


However, I would still like to get answers on questions 1 and 2 for 
future reference so any thoughts would be great.


Thanks!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HTML Email Composing Problem.

2007-07-27 Thread Richard Lynch
On Fri, July 27, 2007 11:01 am, Tom Ray [Lists] wrote:
 I would have to agree with you Chris, there a many legitimate reasons
 for having HTML mail. I was trying to be a nice guy and send both the
 plain text version and the html version out but like I said, I
 couldn't
 get it to stop displaying both.

Just set up two different mailing lists (internally) and when a user
subscribes they can pick html/plain and you subscribe them to the
correct list.

PS
There may be legitimate reasons why somebody thinks they need to
send me HTML enhanced (cough, cough) email, but I've personally NEVER
found one that had sufficient added value to make it worth receiving
as HTML enhanced (cough, cough) email.

YMMV

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] HTML Email Composing Problem.

2007-07-26 Thread Tom Ray [Lists]
I'm trying to use PHP to compose an HTML formatted email and I'm running 
into some small problems.


1) When using Content-Type: multipart/mixed during my testing both 
Thunderbird and Gmail display the plain text and html version of the 
email and Firefox attaches the html portion as an attachement.


2) When using Content-Type: multipart/alternative during my testing 
Thunderbird only showed the HTML portion of the email but Gmail 
displayed only a blank email.



3) Spam Assassin doesn't like it either way and tags the email as SPAM 
for the following reasons:


0.6 HTML_SHORT_LENGTH  BODY: HTML is extremely short
0.0 HTML_MESSAGE   BODY: HTML included in message
1.5 MIME_BASE64_TEXT   RAW: Message text disguised using base64 encoding

Here is the script, which I mostly borrowed from tutorials/how to examples on 
the web.

$to=Tom Ray [EMAIL PROTECTED]; 
$from=Support [EMAIL PROTECTED];

$subject=Test HTML Email;

// -- plain text part of the email 
$msgtext=This is HTML Testing; 


//-- html part of the email
$htmlmsg=chunk_split(base64_encode(This is bHTML/b testing.));  


//-- create boundary
$sep = strtoupper(md5(uniqid(time(;

//-- create email
$header = From: $from\n;
$header .= MIME-Version: 1.0\n;
$header .= Content-Type: multipart/mixed; boundary=$sep\n\n;   


$header .= --$sep\n;
$header .= Content-Type: text/plain; charset=ISO-8859-1\n;   
$header .= Content-Transfer-Encoding: 8bit\n\n;

$header .= $msgtext\n\n;

$header .= --$sep\n;
$header .= Content-Type: text/html; charset=ISO-8859-1\n;
$header .= Content-Transfer-Encoding: base64\n\n;
$header.= $htmlmsg\n\n;
$header .= --$sep--;

//-- mail it
mail($to, $subject, , $header);


Any help/suggestions would be appreciated.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] HTML Email Composing Problem.

2007-07-26 Thread Richard Lynch
On Thu, July 26, 2007 2:46 pm, Tom Ray [Lists] wrote:
 I'm trying to use PHP to compose an HTML formatted email

Don't do that...

 3) Spam Assassin doesn't like it either way and tags the email as SPAM
 for the following reasons:

  0.6 HTML_SHORT_LENGTH  BODY: HTML is extremely short
  0.0 HTML_MESSAGE   BODY: HTML included in message
  1.5 MIME_BASE64_TEXT   RAW: Message text disguised using base64
 encoding

The only people who send out these stupid HTML enhanced (cough, cough)
messages are spammers.

Okay, and people not clueful enough to turn off HTML in bad email
clients that default it on, so that they can send a zero-value-added
email with the HTML enhancment (cough, cough).

Still, the point is that you will most likely never ever fix problem 3.

[opinion]
HTML enhanced email is a blight up on the universe and should be
eradicated whenever and wherever possible.
[/opinion]

YMMV
NAIAA

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php