Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #14189 > unrolled thread
| Started by | Bo Wísén <bowisen@telia.com> |
|---|---|
| First post | 2014-08-22 09:57 +0200 |
| Last post | 2014-08-23 11:16 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.php
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
| From | Bo Wísén <bowisen@telia.com> |
|---|---|
| Date | 2014-08-22 09:57 +0200 |
| Subject | Cellpadding in HTML mail |
| Message-ID | <lt6t67$18td$1@adenine.netfront.net> |
Hi, 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">. What am I doing wrong? / Bo --- Detta epostmeddelande innehåller inget virus eller annan skadlig kod för avast! antivirus är aktivt. http://www.avast.com --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
[toc] | [next] | [standalone]
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Date | 2014-08-22 16:44 +0200 |
| Message-ID | <53F7574C.2020008@arnowelzel.de> |
| In reply to | #14189 |
Am 2014-08-22 09:57, schrieb Bo Wísén: > Hi, > > 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">. > > What am I doing wrong? "=3D" is the encoded version of "=" for quoted-printable encoding. Since "=" has a special meaning in quoted-printable it has to be escaped by using "=3D". So - if your mail body is sent as quoted-printable, all is OK - just make sure, the Content-Transfer-Encoding header also contains "quoted-printable". Also see <https://www.ietf.org/rfc/rfc2045.txt> and <http://en.wikipedia.org/wiki/Quoted-printable>. -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de http://fahrradzukunft.de
[toc] | [prev] | [next] | [standalone]
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
|---|---|
| Date | 2014-08-23 11:16 +0200 |
| Message-ID | <2123639.R9oLNggZFM@PointedEars.de> |
| In reply to | #14189 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web