This is a discussion on PHP Mail functions within the PHP Programming forums, part of the Web Development category; Here is the example for sending HTML email PHP Code: <?php // multiple recipients $to = '...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Here is the example for sending HTML email PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| Sponsored Links |
| |||
| The Windows implementation of mail() differs in many ways from the Unix implementation. First, it doesn't use a local binary for composing messages but only operates on direct sockets which means a MTA is needed listening on a network socket (which can either on the localhost or a remote machine). Second, the custom headers like From:, Cc:, Bcc: and Date: are not interpreted by the MTA in the first place, but are parsed by PHP. As such, the to parameter should not be an address in the form of "Something <someone@example.com>". The mail command may not parse this properly while talking with the MTA.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| It is worth noting that the mail() function is not suitable for larger volumes of email in a loop. This function opens and closes an SMTP socket for each email, which is not very efficient.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| If intending to send HTML or otherwise Complex mails, it is recommended to use the PEAR package PEAR::Mail. For the sending of large amounts of email, see the PEAR::Mail, and PEAR::Mail_Queue packages.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Actually imap_mail ( ) allows sending of emails with correct handling of Cc and Bcc receivers. This is useful when using PHP as a mail client for multiple users.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| IMAP stands for Internet Message Access Protocol. It is a method of accessing electronic mail or bulletin board messages that are kept on a (possibly shared) mail server. In other words, it permits a "client" email program to access remote message stores as if they were local. For example, email stored on an IMAP server can be manipulated from a desktop computer at home, a workstation at the office, and a notebook computer while traveling, without the need to transfer messages or files back and forth between these computers.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| IMAP supports both connected (online) and disconnected (offline) modes of operation. E-mail clients using IMAP generally leave messages on the server until the user explicitly deletes them. This and other facets of IMAP operation allow multiple clients to access the same mailbox. Most e-mail clients support either POP3 or IMAP to retrieve messages; however, fewer Internet Service Providers (ISPs) support IMAP. IMAP4 offers access to the mail store; the client may store local copies of the messages, but these are considered to be a temporary cache; the server's store is authoritative.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| IMAP function enable you to operate with the IMAP protocol, as well as the NNTP, POP3 and local mailbox access methods. Be warned however, that some of IMAP functions will not work correctly with the POP protocol.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| E-mail messages are generally sent to an e-mail server that stores received messages in the recipient's e-mail mailbox. The user later retrieves these messages with either a web browser or an e-mail client that uses one of a number of e-mail retrieval protocols. While some clients and servers preferentially use vendor-specific, proprietary protocols, most support the Internet standard protocols SMTP for sending e-mail and POP3 and IMAP4 for retrieving e-mail, allowing interoperability with other servers and clients. For example, Microsoft's Outlook client typically uses a proprietary protocol to communicate with an Exchange server as does IBM's Notes client when communicating with a Domino server, but all of these products also support SMTP, POP3, and IMAP4. Support for the Internet standard protocols allows many other e-mail clients such as Pegasus Mail or Mozilla Thunderbird (see comparison of e-mail clients) to access these servers and similarly allows the clients to be used with other servers (see list of mail servers).
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| IMAP is often used in large networks; for example, a college campus mail system. IMAP allows users to access new messages instantly on their computers, since the mail is stored on the network. With POP3, users either download the e-mail to their computer or access it via the web. Both methods take longer than IMAP, and the user must either download any new mail or "refresh" the page to see the new messages.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| The mail() function allows you to send emails directly from a script.For the mail functions to be available, PHP requires an installed and working email system. The program to be used is defined by the configuration settings in the php.ini file. PHP: indicates the earliest version of PHP that supports the function. mail() Allows you to send emails directly from a script |
| |||
| As I know to send an email with attachment we need to use the multipart/mixed MIME type that specifies that mixed types will be included in the email. Moreover, we want to use multipart/alternative MIME type to send both plain-text and HTML version of the email.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Here is the example PHP Code:
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| As you can see, sending an email with attachment is easy to accomplish. In the preceding example we have multipart/mixed MIME type, and inside it we have multipart/alternative MIME type that specifies two versions of the email. To include an attachment to our message, we read the data from the specified file into a string, encode it with base64, split it in smaller chunks to make sure that it matches the MIME specifications and then include it as an attachment.
__________________ With, J. Jeyaseelan Everything Possible |
| |||
| Hi Quote:
PHP Code: Regards Falcon ![]() |
| |||
| Hi MIME means Multipurpose Internet Mail Extension MIME is a specification for the format of non-text e-mail attachments that allows the attachment to be sent over the Internet. MIME allows your mail client or Web browser to send and receive things like spreadsheets and audio, video and graphics files via Internet mail. MIME was defined in 1992 by the Internet Engineering Task Force (IETF). The distinguishing characteristic of a MIME message is the presence of the MIME headers. As long as your mail recipients also have e-mail software that is MIME-compliant (and most e-mail software is), you can swap files containing attachments automatically. Here are some tips for e-mail attachments: Regards Falcon ![]() |
| |||
| Hi, As you said that MIME extends the format of Internet mail to allow non-US-ASCII textual messages, non-textual messages, multipart message bodies, and non-US-ASCII information in message headers.
__________________ With, J. Jeyaseelan Everything Possible |