Discussion:
Zend_Mail & Zend_Mail_Transport_Smtp Problems
Tim Weyand
2007-06-22 10:21:17 UTC
Permalink
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-***@public.gmane.org','Tim Weyand');
$Mail->addTo('another.mailadress-***@public.gmane.org','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.
--
View this message in context: http://www.nabble.com/Zend_Mail---Zend_Mail_Transport_Smtp-Problems-tf3963833s16154.html#a11249613
Sent from the Zend MFS mailing list archive at Nabble.com.
Tim Weyand
2007-06-22 09:53:32 UTC
Permalink
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-***@public.gmane.org','Tim Weyand');
$Mail->addTo('another.mailadress-***@public.gmane.org','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
Nico Edtinger
2007-06-25 20:02:03 UTC
Permalink
Hi Tim!
Post by Tim Weyand
[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.
Post by Tim Weyand
[Zend_Mail]
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.
$Mail = new Zend_Mail;
$transport = new Zend_Mail_Transport_Smtp(mailserver);
Zend_Mail::setDefaultTransport($transport);
$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.
Post by Tim Weyand
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.
Post by Tim Weyand
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?
Post by Tim Weyand
best regards,
Tim Weyand
Freenet AG
nico
Tim Weyand
2007-07-02 10:03:55 UTC
Permalink
Hi Nico,
thanks for your reply.
Post by Nico Edtinger
Post by Tim Weyand
[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.
Post by Nico Edtinger
Post by Tim Weyand
[Zend_Mail]
If i send an email to a emailadress of our company the
email body gets
Post by Tim Weyand
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 :)
Post by Nico Edtinger
Post by Tim Weyand
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.
Post by Nico Edtinger
Post by Tim Weyand
Could "delTo", "delCc", "delBcc", "delSubject", "delFrom"
methods be
Post by Tim Weyand
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-C1q0ot2/***@public.gmane.org assigned me the right to add a comment.

best regards,
Tim Weyand

Freenet AG

Loading...