B
B
Bogdan Pasechnik2012-05-29 13:17:36
PHP
Bogdan Pasechnik, 2012-05-29 13:17:36

How to implement receiving mail using api cPanel?

It was required to implement a simple mail service. Create/delete mail accounts. Sending and receiving letters.
I figured out the creation, deletion and sending of mail. Used the cPanel API.
We connect the class github.com/CpanelInc/xmlapi-php

$xmlapi = new xmlapi(IP, ROOT_USER, ROOT_PASSWORD);<br/>

now create a mailing address
$result = $xmlapi-&gt;api2_query(ACCOUNT, &quot;Email&quot;, &quot;addpop&quot;, array('domain'=&gt;DOMAIN, 'email'=&gt;'testemail', 'password'=&gt;'testpassword', 'quota'=&gt;20) );<br/>

delete
$result = $xmlapi-&gt;api2_query(ACCOUNT, &quot;Email&quot;, &quot;delpop&quot;, array('domain'=&gt;DOMAIN, 'email'=&gt;'testemail') );<br/>

I think it's not worth talking about sending mail =) I'm
interested in
1. how to get the mail that came to [email protected]
2. how to get mail for a period or a limited amount. for example, the last 10 messages if there are a lot of them in the inbox.
3. whether there are classes for parsing the message and bringing it into a divine form. If the message contains text this will not be a problem, but if there are attached files it will be somewhat more difficult.
I really hope for advice.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Bogdan Pasechnik, 2012-05-29
@taral

I assume that this is not implemented through cPanel. No wonder they use third-party solutions to display mail.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question