php - 使用href在php中发送邮件
问题描述
这是消息内容
<?php
$message = "
<html><body>
<table border='1' width='100%' >
<thead>
<tr>
<th scope='col'>Product Name</th>
<th scope='col'>Quantity</th>
<th scope='col'>Total Price (RM)</th>
</tr>
</thead>
";
?>
信息作为表格
<a href="mailto:<?php echo $Display["SupplierEmail"]; ?>?subject=Buy a Product&cc=<?php echo $AdminEmail; ?>&body=<?php echo $message; ?>">Send me an email</a>
输出变为 打开电子邮件示例
图片中的问题 [1]:https://i.stack.imgur.com/yrhVX.png
如何解决?
解决方案
大多数电子邮件程序不会让您嵌入 html,但我知道它的格式不是很好,但是如何创建一个 from,用默认数据填充它?
<form action="mailto:postmaster@mydomain.com" method="post" enctype="text/plain">
<input type="text" name="productname" id="productname" value="answer" />
<input type="text" name="quantity" id="quantity" value="42" />
<input type="text" name="price" id="price" value="everything" />
<input type="submit" name="submit" value="Send" />
</form>
您可以根据需要隐藏表单字段,并且可以使用制表符和空格进行格式化
推荐阅读
- docker - Docker:无法安装 openssh-server
- python-3.x - 日期之间的比较以 -1 开头
- java - 无法建立 Hibernate SessionFactory;org.hibernate.MappingException:无法确定类型
- httpclient - Keycloak - 如何为 keycloak 库中使用的 http 客户端设置超时
- c++ - _getch() 前几次没有检测到击键
- mysql - 时序数据类型的 SQL 数据库结构
- javascript - javascript和HTML如何找到鼠标的位置?
- django - 将 Django ForeignKey 设置为多个模型
- java - 布尔值始终返回 true
- ruby - 使用基于“命名空间”的应用程序时如何修复“未初始化的常量”