Home arrow PHP arrow Page 2 - Managing Email

MX Records - PHP

If you want to write PHP scripts that handle email, there are a few things you need to understand first. This article, the first of two parts, introduces you to these concepts. It is excerpted from chapter 8 of the Zend PHP Certification Study Guide, written by Zend Technologies (Sams; ISBN: 0672327090).

  1. Managing Email
  2. MX Records
  3. Other Emerging Technologies
  4. Preparing PHP
  5. Sending Email
By: Sams Publishing
Rating: starstarstarstarstar / 6
November 09, 2006

print this article



When an MTA has an email message to send to another MTA, it has to convert the address in the To:, Cc:, or Bcc: line into an IP address. Everything after the @ sign in the address is taken to be the email domain. This is normally something such as @php.net.

The email domain isn't the real name of a server. It looks like a real name (and has to follow the same rules), but it isn't. It's actually a special kind of DNS alias.

To receive email for your email domain, you have to add an MX record for that email domain to your DNS server.

Note - If you don't set up an MX record in your DNS server, the MTA will look for a matching A record instead.

MUA—Mail User Agent

The Mail User Agent (MUA) is the jargon name for an email client.

Examples of Mail User Agents are

  • Outlook Express

  • Evolution

  • KMail

  • pine

  • mutt

  • Hotmail

A PHP script that sends email is also a type of Mail User Agent.

Mail User Agents read email directly from files on disk, via network protocols such as POP3 or IMAP, or via proprietary network protocols (as used by Microsoft Exchange).

Mail User Agents normally send their email by connecting to a Mail Transport Agent over the network via the SMTP network protocol. Some UNIX-based Mail User Agents might send their email instead by executing a sendmail wrapper program.

When a Mail User Agent connects to an MTA via SMTP to send email, it might use SASL to authenticate the user.

SASL—Simple Authentication and Security Layer

The Simple Authentication and Security Layer (SASL) is a tried and trusted way to bolt user-authentication onto existing network protocols. SMTP has been extended (via the SMTP AUTH command) to support SASL.

If an MTA has been configured to require authentication, only MUAs with built-in support for the SMTP AUTH command will be able to connect to send email.

>>> More PHP Articles          >>> More By Sams Publishing

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: