Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Reddit.com:
How do you test email when in development?
Aug 31, 2011 @ 17:58:53

In this recent post to Reddit, a question is asked that's an issue for many developers testing the email sending abilities of their applications - how can it be tested effectively without outside services flagging you as a possible spammer.

So how do you guys do it? My current solution is to just output the email template HTML straight to the browser, but this doesn't always work. [...] I have considered sending emails through to my GMail, but I run my tests quite often and I'm not sure Google would be too happy with the amount I send. [...] I'm sure there's a better way I can handle this without modifying my code too much. Suggestions appreciated.

Suggestions from the comments include:

  • a local SMTP/IMAP server configured to catch all emails being sent
  • Changing the address based on an environment flag
  • Using "@example.com"
  • Saving the email as a .msg file for later review

There's also suggestions of other Mac or Windows software to mimic the mail server like smtp4dev and MockStmp

tagged: test email recommendation server imap stmp windows osx

Link:

WebReference.com:
Build Your Own PHP Web Mailer
Aug 11, 2010 @ 15:56:49

On WebReference.com today there's a new tutorial about creating a PHP interface for sending and receiving emails directly from a mailer script.

In this tutorial you will learn how to create your own PHP Web mailer. You will learn the necessary steps for creating an email account and making connections to the server protocols for sending and receiving email. You also will get a listing of PHP commands that you can use to customize the Web mailer to your specifications.

The script makes manual connections to the servers instead of using something like mail and sends the raw commands to send via an SMTP server and fetch over a POP3 connection. There's also an example of making an IMAP connection and sending commands to get the current list of messages, current status and fetch the messages.

tagged: web mailer tutorial imap stmp pop3

Link:

Web Development Blog:
Sending e-mails via SMTP with PHPmailer and Gmail
Sep 04, 2009 @ 19:56:14

On the Web Development Blog there's a recent post about using the PHPMailer package to send email out via the Google Mail servers.

These days I tried some plugin to send mail message within bbpress via SMTP. Since my domains email is hosted with Google applications I decided to send my messages via the SMTP server from Gmail. I found several articles and tutorials, but a lot of them didn’t work for me. [...] You need for this code example a PHP5 enabled web host (I tested only on Linux), the port 465 need to be open and of course you need a Gmail or Google applications account.

Complete code is provided - a smtpmailer function that takes in the standard mail parameters (to, from, subject, msg) and ships the message off to the Gmail STMP servers (on their custom port 465).

tagged: email tutorial gmail phpmailer stmp

Link:

Richard Heyes' Blog:
SMTP class rehash
Dec 07, 2007 @ 18:56:00

Richard Heyes has posted his STMP class for download (after some good testing):

With the help of a few anonymous people (thanks), I've rehashed the smtp class for PHP5 and made it available. It should be considered beater quality at the moment, so don't go using it for production code unless you like to live dangerously (Ooooh...).

He includes both a code example and a link to download the library.

tagged: stmp class connection download php5 stmp class connection download php5

Link:

Richard Heyes' Blog:
SMTP class rehash
Dec 07, 2007 @ 18:56:00

Richard Heyes has posted his STMP class for download (after some good testing):

With the help of a few anonymous people (thanks), I've rehashed the smtp class for PHP5 and made it available. It should be considered beater quality at the moment, so don't go using it for production code unless you like to live dangerously (Ooooh...).

He includes both a code example and a link to download the library.

tagged: stmp class connection download php5 stmp class connection download php5

Link:


Trending Topics: