php - 在 php 发送的电子邮件中发送 html 链接

标签 php html email

我正在使用 html 表单 textarea 和 php 通过我的网站发送电子邮件

如何在邮件正文中放置链接。我喜欢这个

<a href="http://www.xxxxx.com/">Visit the site</a>

但我收到的是全文。我也试过了

<html>
  <head>
    <title>Test</title>
  </head>
  <body>
    <a href="http://www.xxxxx.com/">Visit the site</a>
  </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";

参见 Example #4 Sending HTML email

关于php - 在 php 发送的电子邮件中发送 html 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15826283/

相关文章:

html - Bootstrap 自动高度面板

javascript - html,js 中的 css 编辑器

javascript - 发送网格 - 当我使用 api 发送电子邮件时,我收到的电子邮件缺少所有设计,例如只显示文字

email - 通过 Google Cloud Platform 从 Firebase 发送自动电子邮件(无第三方)

php - 奇数/偶数脚本有问题

php - 用于 Web 应用程序的小型电子表格语言解释器

php - 将信息从 javascript 传递到 php 文件,同时限制用户自己做?

php - Laravel Eloquent 中的复杂连接子句

javascript - 无法为按钮添加属性

node.js - Node :send a mail via a custom smtp server