Introduction to Zend_Mail

February 2nd, 2010

A big thank you to Ryan Horn for putting together this great screencast about Zend_Mail. Ryan took the time to talk about how to setup a dev environment that uses a gmail account. This is perfect for folks like myself who work in a development environment that’s behind an annoying ISP firewall on SMTP (port 25). Ryan Horn is a web developer based out of Buffalo, feel free to reach him by email.

Grab a copy of the project or browse the repository.

 

discuss video in the forum

10 Responses to “Introduction to Zend_Mail”

  1. Derick says:

    Very nice screencast Ryan. Looking forward to seeing more.

  2. Artur Górski says:

    I think that Bootstrap.php should look like this:

    getOption(‘email’);

    $smtpHost = $emailConfig['transportOptionsSmtp']['host'];
    unset($emailConfig['transportOptionsSmtp']['host']);

    $mailTransport = new Zend_Mail_Transport_Smtp($smtpHost, $emailConfig['transportOptionsSmtp']);

    Zend_Mail::setDefaultTransport($mailTransport);
    }
    }

  3. Balu says:

    Please stop mocking the ISPs about a blocked port 25. They actually do it the right way. Port 25 is meant to be used by mail_servers_ to transfer mails between each other.

    Clients that need to send mail should use port 587 (“submission”). This is described in RFC 2476 that is about 11 years old now.

    This distinction simply needs to get into the heads of all mail server administrators and us of course. Since Port 587 requires authentication it would be a lot harder for Spammers to send out their crap. And if they misuse an account it’s a lot easier to figure that out and block it.

    Providers that block port 25 outgoing from all machines on their internal network (but official mailservers) actually help to fight spam.

    If you really need your own mailserver make sure it uses your providers machine as a smarthost and you’re done.

    PS: Yes, there are caveats, but those lurk everywhere.

  4. jon says:

    Hi Balu,

    First of all, I didn’t think my first comment was so slanderous, regardless, I’m sorry you found my tone “mocking”. When I state that a firewall is annoying, it is! Especially when a developer is trying to build a web application!

    I disagree with forced port blocking, since it sounds like a way to stop spamming however I think it’s just a means for ISP’s to charge “business rates” for unblocked ports.

    Thanks for mentioning port 587, as I hadn’t heard of it before.

  5. Balu says:

    Perhaps I was a little too harsh myself by using “mocking”, but that’s the only word in English I know that goes in that direction ;-) . German is my mother tongue…

    Anyway. I understand your concerns and I’m often hindered by a blocked port myself. But besides having to code PHP I’m a mailserver administrator who needs to fight those *censored* *censored* *censored* idiots who use our internet to do their bad stuff.

    And after all there are ways to work around a blocked port 25 while developing. E.g. a local mailserver or simply creating an application that authenticates itself while using the ISPs mailserver.

    I’m fairly sure that Zend_Mail supports authenticated sending over a different port than 25 ;-) . (Need to check though).

    A big problem with port 587 is that most mailserver administrators don’t know it either. :-/ There was a time when admins knew their RFCs… damn – I’m getting old. ;-)

  6. jon says:

    Thanks for sharing where you’re coming from. In fact Zend_Mail does support it and Ryan did a great job covering smtp authentication in his video.

  7. lion21 says:

    very good zend cast , looking disparately more from you ryan :) , in last few secs u made a silly ignorable error by unsetting an wrong variable ;)

  8. Bruno says:

    I’m missing something here… you keep the smtpOptions in the application.ini and in the controller?

  9. Jose Grieco says:

    Simple and nice.
    There is no need use code in Bootstrap.php:

    look Zend_Application_Resource_Mail in http://framework.zend.com/manual/en/zend.application.available-resources.html

  10. pirroman says:

    No body seems to have had this problem, but I am getting “Could not open socket”, although the code looks pretty fine.
    Anyone has any idea?

Leave a Reply

Desktop RSS feed iPhone + iPod