Zend_Mail & Zend_Mail_Transport_Smtp Problems

View: New views
3 Messages — Rating Filter:   Alert me  

Zend_Mail & Zend_Mail_Transport_Smtp Problems

by Tim Weyand :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
since ZendFramework is almost "stable", i thought it would be a great idea to use it for a current Project. The main purpose of the application is to send a lot of mails.
 
I have currently some problems and maybe someone can help me out.
 
[Zend_Mail_Transport_Smtp]
I am missing the "connect()" and "disconnect()" function, which is described in the current manual. These funktions could solve some problems of mine.
 
[Zend_Mail]

first problem :

If i send an email to a emailadress of our company the email body gets broken appart. For example freenet-ag.de breaks the message, freenet.ag or freenet.de does not break the message appart.
 
Code Example:
$Mail =  new Zend_Mail;
$transport = new Zend_Mail_Transport_Smtp(mailserver);
Zend_Mail::setDefaultTransport($transport);  
 
$Mail->setFrom('some.mailadress@freenet.ag','Tim Weyand'); $Mail->addTo('another.mailadress@freenet-ag.de','Tim Weyand');
$Mail->setSubject('Test Mail');
$Mail->setBodyText('This is a test. The Email Adress will break this Message a part! It will only occure on longer Mails. HTML Mails are unviewable.');
$Mail->send();

second problem :

International domains seem to not work. I get a exception "501 5.5.4 Invalid Adress", if i add a valid international email domain to the receipient list. The tested domain was "tüsten.de".
 
Feature "Wish" :
Could  "delTo", "delCc", "delBcc", "delSubject", "delFrom" methods be added to Zend_Mail?
 
best regards,
Tim Weyand

Freenet AG

P.s. i hope this does not come up twice, in the mailing list.

Re: Zend_Mail & Zend_Mail_Transport_Smtp Problems

by Nico Edtinger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tim!

[22.06.2007 12:21] Tim Weyand wrote:
> [Zend_Mail_Transport_Smtp]
> I am missing the "connect()" and "disconnect()" function, which is  
> described
> in the current manual. These funktions could solve some problems of  
> mine.

What I've seen in the code you don't have to call connect() and  
disconnect() any longer.
Simon is this correct? I'll update the docs.

> [Zend_Mail]
>
> first problem :
>
> If i send an email to a emailadress of our company the email body gets
> broken appart. For example freenet-ag.de breaks the message,  
> freenet.ag or
> freenet.de does not break the message appart.
>
> Code Example:
> $Mail =  new Zend_Mail;
> $transport = new Zend_Mail_Transport_Smtp(mailserver);
> Zend_Mail::setDefaultTransport($transport);
>
> $Mail->setFrom('some.mailadress@...','Tim Weyand');
> $Mail->addTo('another.mailadress@...','Tim Weyand');
> $Mail->setSubject('Test Mail'); $Mail->setBodyText('This is a test.  
> The
> Email Adress will break this Message a part! It will only occure on  
> longer
> Mails. HTML Mails are unviewable.'); $Mail->send();

That's the old newline problem. There's currently no fix, sorry - see  
http://framework.zend.com/issues/browse/ZF-1041
But there's at least a workaround. You can change the encoding in  
setBodyText() and setBodyHtml() with the third parameter.


> second problem :
>
> International domains seem to not work. I get a exception "501  
> 5.5.4 Invalid
> Adress", if i add a valid international email domain to the  
> receipient list.
> The tested domain was "tüsten.de".

This error message is from your SMTP. One solution I could think of  
is translating the IDN to punycode. But there's no such component in  
ZF; maybe http://pecl.php.net/package/idn helps.

> Feature "Wish" :
> Could  "delTo", "delCc", "delBcc", "delSubject", "delFrom" methods  
> be added
> to Zend_Mail?

Not in 1.0. I've created a new task http://framework.zend.com/issues/ 
browse/ZF-1626 and will look into it. To you have a use-case so I can  
understand why and when you need it?

> best regards,
> Tim Weyand
>
> Freenet AG

nico

AW: Zend_Mail & Zend_Mail_Transport_Smtp Problems

by Tim Weyand :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
Hi Nico,
thanks for your reply.

[25.06.2007 22:02] Nico Edtinger wrote
> [22.06.2007 12:21] Tim Weyand wrote:
> > [Zend_Mail_Transport_Smtp]
> > I am missing the "connect()" and "disconnect()" function, which is
> > described in the current manual. These funktions could solve some
> > problems of mine.
>
> What I've seen in the code you don't have to call connect() and
> disconnect() any longer.
> Simon is this correct? I'll update the docs.

It is correct, that normally you wouldn't need an connect() and disconnect() function. I think that the controlling of connections should rather made by (optional?) methods than by creating and destroying the Zend_Mail_Transport. Also if you get an (Mailserver) connection timeout you currenty can only destroy and create a new instance.

> > [Zend_Mail]
> > first problem :
> >
> > If i send an email to a emailadress of our company the
> email body gets
> > broken appart. For example freenet-ag.de breaks the message,
> > freenet.ag or freenet.de does not break the message appart.
> >
> > Code Example [...]
>
> That's the old newline problem. There's currently no fix, sorry - see
> http://framework.zend.com/issues/browse/ZF-1041
> But there's at least a workaround. You can change the encoding in
> setBodyText() and setBodyHtml() with the third parameter.

Hmm it seems to work. Thank you :)

> > second problem :
> >
> > International domains seem to not work. I get a exception "501
> > 5.5.4 Invalid
> > Adress", if i add a valid international email domain to the
> > receipient list.
> > The tested domain was "tüsten.de".
>
> This error message is from your SMTP. One solution I could
> think of is translating the IDN to punycode. But there's no
> such component in ZF; maybe http://pecl.php.net/package/idn helps.

Maybe this (rfc3490) should be added in a future release of ZendFramework? Which would make the use of an second framework/functions outside of ZendFramework unnecessary.

> > Feature "Wish" :
> > Could  "delTo", "delCc", "delBcc", "delSubject", "delFrom"
> methods be
> > added to Zend_Mail?
>
> Not in 1.0. I've created a new task http://framework.zend.com/issues/
> browse/ZF-1626 and will look into it. To you have a use-case
> so I can understand why and when you need it?

I will write use-cases as soon as cla@... assigned me the right to add a comment.

best regards,
Tim Weyand

Freenet AG