Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14192

Re: Cellpadding in HTML mail

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.php
Subject Re: Cellpadding in HTML mail
Date 2014-08-23 11:16 +0200
Organization PointedEars Software (PES)
Message-ID <2123639.R9oLNggZFM@PointedEars.de> (permalink)
References <lt6t67$18td$1@adenine.netfront.net>

Show all headers | View raw


Bo Wísén wrote:

> I'm trying to send a HTML mail using the mail() function in PHP. This is
> usually no problem. But now I'm trying to set a cellpadding value in the
> existing table. I've tried two ways in the message text:
> 
> $text .= "<table cellpadding=\"10\">";
> or
> $text .= "table cellpadding=".chr(34)."10".chr(34).">";
> 
> Cellpadding doesn't work and in the source code the above results in
> '<table cellpadding\=3D"10">.

The above code alone cannot result in that.  The evaluated value of the 
right-hand side expression of the first alternative is equivalent to

  '<table cellpadding="10">'

when after “<?php” and before the optional “?>”.  This would be

  <table cellpadding=3D"10">
 
in the Quoted-Printable transfer-encoding that can be used in e-mail.  (3D 
is the hexadecimal code point and US-ASCII/ISO-8859-x/UTF-8 code sequence of 
the character “=” which, because it is special with QP, must be encoded 
there).

> What am I doing wrong?

You are not posting the real code or not all the relevant code.

Your code is generally written too complicated.  You can write

  $text .= '<table cellpadding="10">';

to achieve the same.  You want to consider using implode() instead.

Your second posted alternative is, if not syntactically wrong, possibly 
ineffective: you have omitted the leading “<”.

If possible, do not send HTML e-mail.  If that is not possible, at least 
send a multi-part e-mail so that people who prefer not to have HTML in their 
e-mails can read the plain-text version.

For such e-mails you should use wrappers, not the mail() function directly.  
We have discussed this recently; please search before you post.

> ---
> Detta epostmeddelande innehåller inget virus eller annan skadlig kod för
> avast! antivirus är aktivt. http://www.avast.com

Yours is not an e-mail eventually, so this pseudo-signature does not belong.  
It also makes no sense to those who do not understand the language in which 
it is written.  Please disable it.
 
> --- news://freenews.netfront.net/ - complaints: news@netfront.net ---

You should avoid using this service because it is used mainly by trolls and 
spammers, and its appends this pseudo-signature to your postings.

-- 
PointedEars
Zend Certified PHP Engineer
Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Cellpadding in HTML mail Bo Wísén <bowisen@telia.com> - 2014-08-22 09:57 +0200
  Re: Cellpadding in HTML mail Arno Welzel <usenet@arnowelzel.de> - 2014-08-22 16:44 +0200
  Re: Cellpadding in HTML mail Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-08-23 11:16 +0200

csiph-web