RE: [fw-general] Problems with Zend_Mail

2010-03-18 Thread Thomas D.
Mads Lie Jensen wrote:
> This might very well be the problem 
> The content of the email is build using a Zend View, and all files from
> my editor are saved with unix-lineendings, ie. LR.
> 
> I will try your suggestion, using CRLF as line-endings and test with
> that. It's just a bit tricky, since none of my computers have Outlook
> Express or the possibility to get it.

Your content and the way you create it shouldn't be the problem.
It's Zend_Mail's job (in detail the used transporter is responsible) to take
care about the given values.

For example, if you call the PHP function mail(), than mail() is your
transporter. This functions is responsible for the values you pass to this
function.

Seems like you are using the default transporter. The default transporter
seems to use PHP_EOL. Like Ryan stated, that violates RFC822 and RFC2822.
Maybe this patch will fix your problem (patched against v1.10.2):

Index: Mail/Transport/Sendmail.php
===
--- Mail/Transport/Sendmail.php (revision 21549)
+++ Mail/Transport/Sendmail.php (working copy)
@@ -58,7 +58,7 @@
  * @var string
  * @access public
  */
-public $EOL = PHP_EOL;
+public $EOL = "\r\n";
 
 /**
  * error information


If this won't fix your problem, could you please provide a raw dump of such
a broken mail (your provided dump is incomplete).


-- 
Regards,
Thomas




Re: [fw-general] Problems with Zend_Mail

2010-03-18 Thread Mads Lie Jensen
Hej Ryan Schmidt 

Den Thu, 18 Mar 2010 08:08:51 -0500 sendte du en mail til mig, angÄende
Re: [fw-general] Problems with Zend_Mail

>>> =0ATak for tilmeldingen til Kunstmesse 2010=0A=0ADenne messe finder sted=
>>> L=F8rdag den 25. september 2010 - s=F8ndag den 26. september 2010=0A=0A=
>>> Du har indtastet f=F8lgende data:=0A=0A  Tilmelding nr.: 125=0A=


 
>> What am I doing wrong here? In my own mailprogram (Forte Agent) it is
>> showing as a nicely formatted text-email. Viewing it from my gmail
>> account it is also shown as expected.
>
>I haven't used Zend_Mail, but I have done some newsletter emailing so I have 
>some experience with common mail sending errors. Mail standards say line 
>endings in email must be the DOS CRLF pair, on all platforms. In your email I 
>see a lot of "=0A" which is the encoding for the UNIX LF line ending. Is it 
>possible your code, or Zend Framework code, is using "\n" or PHP_EOL as a line 
>separator? If so, that would be an error; the line separator must be "\r\n". 
>Some mail servers and mail clients are pickier about this than others, which 
>would explain why only some of your users see this problem.

This might very well be the problem 
The content of the email is build using a Zend View, and all files from
my editor are saved with unix-lineendings, ie. LR.

I will try your suggestion, using CRLF as line-endings and test with
that. It's just a bit tricky, since none of my computers have Outlook
Express or the possibility to get it.

For now, I have switched to PEARs mailclass instead. This worked
perfectly, but I would prefer to use Zend-code where possible. 
-- 
Mads Lie Jensen - m...@gartneriet.dk - ICQ #25478403
Gartneriet - http://www.gartneriet.dk/


Re: [fw-general] Problems with Zend_Mail

2010-03-18 Thread Ryan Schmidt
On Mar 17, 2010, at 02:58, Mads Lie Jensen wrote:

> I'm using Zend_Mail to send out emails from inside a controller. The
> mail is sent like this:
> 
>   $tilmeldingAdresse = $this->_config->email->tilmelding->adresse;
>$tilmeldingNavn =
>utf8_decode($this->_config->email->tilmelding->navn);
>$mail = new Zend_Mail('iso-8859-15');
>$mail->setBodyText($content)
> ->setBodyHtml($contentHtml)
> ->setFrom($tilmeldingAdresse, $tilmeldingNavn)
> ->addCc($tilmeldingAdresse, $tilmeldingNavn)
> ->setHeaderEncoding(Zend_Mime::ENCODING_BASE64)
> ->setSubject('Tilmelding til Lionsmesse');
> 
>if ($til) {
>$mail->addTo($til, '');
>}
> 
>$mail->send();
> 
> Mail is sent ok, and when testing it arrives in my own mailbox as it
> should, looking ok.
> 
> But, some users, all using Outlook Express to view their emails gets
> this:
> 
> 
>> From: =?iso-8859-1?Q?Lions=20Club=20Vr=E5?= <>
>> Cc: tilmeld...@vishvaddukan.dk
>> Date: Thu, 04 Mar 2010 16:14:34 +0100
>> Content-Type: text/plain; charset=iso-8859-1
>> Content-Transfer-Encoding: quoted-printable
>> Content-Disposition: inline
>> MIME-Version: 1.0
>> Message-Id: <20100304151434.b08d967a...@quercus.palustris.dk>
>> X-CM-Analysis: v=1.1 cv=x4l5IIzddOdcCTxRlIDdCFlHT+bXbyaqAaDtMn28a6o= c=1 
>> sm=0 a=Jf0yzMfKMQz/KcSIlVTSog==:17 a=69EAbJre:8 a=gWR6SqXC:8 
>> a=W3anHg1yuHC3kRP9Y-gA:9 a=noP2OTjU9ZttMICO4cZeWNtITM4A:4 
>> a=j_f3kYImlrQA:10 a=EfJqPEOeqlMA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
>> 
>> =0ATak for tilmeldingen til Kunstmesse 2010=0A=0ADenne messe finder sted=
>> L=F8rdag den 25. september 2010 - s=F8ndag den 26. september 2010=0A=0A=
>> Du har indtastet f=F8lgende data:=0A=0A  Tilmelding nr.: 125=0A=
>>   Navn: Morten Gaarden=0A Adresse: Pr=E6steg=E5rdsvej 49=0A  =
>>   Postnr./by: 9480 L=F8kken=0A Telefon: 23367889=0A  =
>> Email: mortengaar...@hotmail.com=0a   Jeg udstiller: Malerier=0A  Beskr=
>> ivelse:=0A=0A=0A=0A  Stand nr.: 24 - Type 5 - 3,5x3,5 meter - 1100,- kr.=
>> =0A=0A=0A  Tilbeh=F8r:=0ABord - 50,- kr.=0AStol=
>> - 10,- kr.=0AStr=F8m - 100,- kr.=0A=0A=0A  Pris i a=
>> lt: 1260 kr.=0A=0AVi skal have din indbetaling hurtigst muligt, og senes=
>> t d.=0Amandag den 5. juli 2010.=0A=0ABel=F8bet (1260,- kr.) skal inds=E6=
>> ttes p=E5 konto: 9070 1620353066- HUSK at angive navn samt tilmeldingsnr=
>> . 125=0A=0AN=E5r din indbetaling er registreret vil du v=E6re at finde p=
>> =E5 siden http://www.vishvaddukan.dk/udstilling/udstillere/".=0A=0A=0A--=
>> =0AMed venlig hilsen,=0ALions Club, Vr=E5.=0A
>> 
> 
> What am I doing wrong here? In my own mailprogram (Forte Agent) it is
> showing as a nicely formatted text-email. Viewing it from my gmail
> account it is also shown as expected.

I haven't used Zend_Mail, but I have done some newsletter emailing so I have 
some experience with common mail sending errors. Mail standards say line 
endings in email must be the DOS CRLF pair, on all platforms. In your email I 
see a lot of "=0A" which is the encoding for the UNIX LF line ending. Is it 
possible your code, or Zend Framework code, is using "\n" or PHP_EOL as a line 
separator? If so, that would be an error; the line separator must be "\r\n". 
Some mail servers and mail clients are pickier about this than others, which 
would explain why only some of your users see this problem.





[fw-general] Problems with Zend_Mail

2010-03-17 Thread Mads Lie Jensen
Hi

I'm using Zend_Mail to send out emails from inside a controller. The
mail is sent like this:

$tilmeldingAdresse = $this->_config->email->tilmelding->adresse;
$tilmeldingNavn =
 utf8_decode($this->_config->email->tilmelding->navn);
$mail = new Zend_Mail('iso-8859-15');
$mail->setBodyText($content)
 ->setBodyHtml($contentHtml)
 ->setFrom($tilmeldingAdresse, $tilmeldingNavn)
 ->addCc($tilmeldingAdresse, $tilmeldingNavn)
 ->setHeaderEncoding(Zend_Mime::ENCODING_BASE64)
 ->setSubject('Tilmelding til Lionsmesse');

if ($til) {
$mail->addTo($til, '');
}

$mail->send();

Mail is sent ok, and when testing it arrives in my own mailbox as it
should, looking ok.

But, some users, all using Outlook Express to view their emails gets
this:


> From: =?iso-8859-1?Q?Lions=20Club=20Vr=E5?= <>
> Cc: tilmeld...@vishvaddukan.dk
> Date: Thu, 04 Mar 2010 16:14:34 +0100
> Content-Type: text/plain; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
> Content-Disposition: inline
> MIME-Version: 1.0
> Message-Id: <20100304151434.b08d967a...@quercus.palustris.dk>
> X-CM-Analysis: v=1.1 cv=x4l5IIzddOdcCTxRlIDdCFlHT+bXbyaqAaDtMn28a6o= c=1 
> sm=0 a=Jf0yzMfKMQz/KcSIlVTSog==:17 a=69EAbJre:8 a=gWR6SqXC:8 
> a=W3anHg1yuHC3kRP9Y-gA:9 a=noP2OTjU9ZttMICO4cZeWNtITM4A:4 
> a=j_f3kYImlrQA:10 a=EfJqPEOeqlMA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117
>
> =0ATak for tilmeldingen til Kunstmesse 2010=0A=0ADenne messe finder sted=
> L=F8rdag den 25. september 2010 - s=F8ndag den 26. september 2010=0A=0A=
> Du har indtastet f=F8lgende data:=0A=0A  Tilmelding nr.: 125=0A=
>Navn: Morten Gaarden=0A Adresse: Pr=E6steg=E5rdsvej 49=0A  =
>Postnr./by: 9480 L=F8kken=0A Telefon: 23367889=0A  =
> Email: mortengaar...@hotmail.com=0a   Jeg udstiller: Malerier=0A  Beskr=
> ivelse:=0A=0A=0A=0A  Stand nr.: 24 - Type 5 - 3,5x3,5 meter - 1100,- kr.=
> =0A=0A=0A  Tilbeh=F8r:=0ABord - 50,- kr.=0AStol=
> - 10,- kr.=0AStr=F8m - 100,- kr.=0A=0A=0A  Pris i a=
> lt: 1260 kr.=0A=0AVi skal have din indbetaling hurtigst muligt, og senes=
> t d.=0Amandag den 5. juli 2010.=0A=0ABel=F8bet (1260,- kr.) skal inds=E6=
> ttes p=E5 konto: 9070 1620353066- HUSK at angive navn samt tilmeldingsnr=
> . 125=0A=0AN=E5r din indbetaling er registreret vil du v=E6re at finde p=
> =E5 siden http://www.vishvaddukan.dk/udstilling/udstillere/".=0A=0A=0A--=
> =0AMed venlig hilsen,=0ALions Club, Vr=E5.=0A
> 

What am I doing wrong here? In my own mailprogram (Forte Agent) it is
showing as a nicely formatted text-email. Viewing it from my gmail
account it is also shown as expected.

-- 
Mads Lie Jensen - m...@gartneriet.dk - ICQ #25478403
Gartneriet - http://www.gartneriet.dk/