The following email code, using an IMAP and PHP tutorial with the mail function to the example, very method, there is a third party plug-ins Oh, phpmailer to send mail.
<?php Connect an IMAP server link with an IMAP port of 143. $mbox = Imap_open ("{Localhost:143}inbox", "user_id", "password"); Connection POP3 Server link, POP3 port is 110. $mbox = Imap_open ("{Localhost/pop3:110}inbox", "user_id", "password"); Connect to the NNTP Server link, NNTP has a port of 119. $NNTP = Imap_open ("{localhost/nntp:119}comp.test", "" "" "); ?>
<?php Connecting to an IMAP server $mbox = Imap_open ("{imap.example.org}", "username", "password", Op_halfopen) Or Die (Connection failed:. Imap_last_error ()); $list = Imap_getmailboxes ($mbox, "{imap.example.org}", "*"); if (Is_array ($list)) { foreach ($list as $key => $val) { echo "($key)"; Echo Imap_utf7_decode ($val->name). ","; echo "". $val->delimiter. "',"; Echo $val->attributes. "<br/>n"; } else { echo "Imap_getmailboxes failed:". Imap_last_error (). "N"; } Turn off IMAP connections Imap_close ($mbox); ?>
<?php Mail ("163@163.com", "Welcome", "Hello, hi!"); ?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.