【发布时间】:2013-09-23 00:43:58
【问题描述】:
对于 HTML 代码,
<textarea name="email_content" rows="6" placeholder="Write something"></textarea>
<a href="./something.php">Send it</a>
对于 PHP 代码,
<?php
$email="abcde@abc.com";
$head = "From: email\r\n";
$head .= "Content-type: text/html\r\n";
$title= "Title Test";
$body = "The text in the textarea";
$success = mail($email, $title, $body, $head);
?>
我希望将 textarea 中的文本转到 PHP 代码中的 $body 中。
另外,我想以 utf-8 格式发送电子邮件。
请帮忙!
【问题讨论】:
-
我建议将其设为
form并将submit按钮设置为看起来像一个链接,而不是尝试使用实际链接来提交表单数据。
标签: javascript php html email