March 2012
Intermediate to advanced
392 pages
10h 17m
English
Outgoing email is sent using the Simple Mail Transfer Protocol (SMTP). Fortunately, PHP’s built-in mail() function handles all SMTP socket-level protocols and handshaking for you. The mail() function acts as your mail client, sending email messages just as Outlook or Thunderbird might.
Before you can use PHP as a mail client, you must edit PHP’s configuration file, php.ini, to point PHP to the mail server’s location. For example, the script in Example 15-1 shows the section of php.ini that configures PHP to work with sendmail, the Unix mail server on many networks.
Example 15-1. Configuring PHP’s mail() function
[mail function] ; For Win32 only. SMTP = localhost ; For Win32 only. ;sendmail_from ...
Read now
Unlock full access