【问题标题】:Webmail access through PHP [closed]通过 PHP 访问 Webmail [关闭]
【发布时间】:2012-10-17 19:18:55
【问题描述】:

我有 Cpanel 和域。我可以通过转到 Cpanel 中的电子邮件帐户选项来创建电子邮件帐户。我的问题是如何从 php Web 应用程序在 Cpanel 中创建电子邮件帐户? 我想要一个正确的指南。

提前致谢。

【问题讨论】:

  • 这还不够。你可以给我推荐一些其他的资源吗?
  • 试试这个,它是从那个页面链接的,看起来应该可以工作:forums.cpanel.net/f42/… 第二个帖子有一种使用 XML 创建转发器的方法。
  • 除非您有权访问服务器 (VPS),否则我认为这是不可能的。如果我错了,请纠正我。

标签: php cpanel pop3 webmail


【解决方案1】:

请检查一下。我希望它会帮助你想要什么。

http://www.zubrag.com/scripts/cpanel-create-email-account.php

【讨论】:

  • 很好的解决方案!不过,您将如何使其更安全?
  • 非常感谢您对 Razin223 的帮助。
【解决方案2】:

看看这个。它用于 gmail 帐户。为您的帐户配置:

/* connect to gmail */
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
$username = 'username@gmail.com';
$password = 'password here';

/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' .   imap_last_error());

/* grab emails */
$emails = imap_search($inbox,'ALL');

/* if emails are returned, cycle through each... */
   if($emails) {

/* begin output var */
$output = '';

/* put the newest emails on top */
rsort($emails);

/* for every email... */
foreach($emails as $email_number) {

    /* get information specific to this email */
    $overview = imap_fetch_overview($inbox,$email_number,0);
    $message = imap_fetchbody($inbox,$email_number,2);

    /* output the email header information */
    $output.= '<div class="toggler '.($overview[0]->seen ? 'read' : 'unread').'">';
    $output.= '<span class="subject">'.$overview[0]->subject.'</span> ';
    $output.= '<span class="from">'.$overview[0]->from.'</span>';
    $output.= '<span class="date">on '.$overview[0]->date.'</span>';
    $output.= '</div>';

    /* output the email body */
    $output.= '<div class="body">'.$message.'</div>';
}

echo $output;
} 

/* close the connection */
imap_close($inbox);

我想这会对你有所帮助。Thanks.razin223

【讨论】:

  • 问题是如何使用 PHP 创建电子邮件帐户,而不是查看电子邮件帐户的邮件。非常酷的脚本虽然:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-18
  • 1970-01-01
  • 2022-11-02
  • 2017-02-24
  • 1970-01-01
相关资源
最近更新 更多