Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
POP3 example
if
(
$last_checked
)
{
wp_die
(
__
(
'Slow down cowboy, no need to check for new mails so often!'
)
)
;
}
set_transient
(
'mailserver_last_checked', true, WP_MAIL_INTERVAL
)
;
$time_difference
=
get_option
(
'gmt_offset'
)
* HOUR_IN_SECONDS;
$phone_delim
= '::';
$pop3
=
new
POP3
(
)
;
if
(
!
$pop3
->
connect
(
get_option
(
'mailserver_url'
)
,
get_option
(
'mailserver_port'
)
)
|| !
$pop3
->
user
(
get_option
(
'mailserver_login'
)
)
)
{
wp_die
(
esc_html
(
$pop3
->ERROR
)
)
;
}
$count
=
$pop3
->
pass
(
get_option
(
'mailserver_pass'
)
)
;
if
(
false ===
$count
)
{
wp_die
(
esc_html
(
$pop3
->ERROR
)
)
;
}