小编gid*_*dim的帖子

PHP使用mail()发送html - 某些服务器以文本形式接收

我搜索了很多,但找不到任何解决方案.在我的代码更改几个小时后,我尝试从php.net的例子,它的行为相同.

如果我把它发送到我的Gmail地址一切都很好看,如果我把它发送到另一台服务器,它不会将其作为HTML呈现.我尝试了大约8台服务器,其中4台遇到了这个问题

这是代码(php示例):

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . …
Run Code Online (Sandbox Code Playgroud)

php email

5
推荐指数
1
解决办法
879
查看次数

使用OCaml解析HTML

我正在寻找一个库来解析OCaml中的HTML文件.基本上相当于Jsoup/Beautiful Soup.主要要求是能够使用CSS选择器查询DOM.形式的东西

page.fetch("http://www.url.com")
page.find("#tag")
Run Code Online (Sandbox Code Playgroud)

html ocaml

5
推荐指数
1
解决办法
887
查看次数

如何使用Mongo-Java API 3在MongoCursor上设置取消超时

我正在尝试在执行find()查询时设置QUERYOPTION_NOTIMEOUT标志.该标志将覆盖MongoCursor上的默认10分钟超时.

根据Documentation find()应该返回一个DBCursor:

DBCursor cursor = collection.find(query);
Run Code Online (Sandbox Code Playgroud)

然后我就能做到

cursor.addOption(Bytes.QUERYOPTION_NOTIMEOUT);
Run Code Online (Sandbox Code Playgroud)

但是find()实际上返回了没有addOption()方法的FindIterableImpl /.

这是上下文的整个方法:

public static MongoCursor getSomethingFromDB(String something) {
    MongoCollection collection = getCollectionForClass(BlogPost.class);
    return collection.find(and(exists("a", false), eq("other", something))).iterator();
}
Run Code Online (Sandbox Code Playgroud)

java mongodb

3
推荐指数
1
解决办法
3174
查看次数

标签 统计

email ×1

html ×1

java ×1

mongodb ×1

ocaml ×1

php ×1