我想在发送邮件时在邮件标题上设置动态标头。我不想使用 SMPT 服务器,如果它将在 codeigniter 中,那么它将是greate。你可以通过给定的图像来了解我想要的确切内容。
来自: Google < dynamic email@gmail.com>
我的代码
<?php
if(isset($_POST['send'])) {
//Email information
$email = $_POST['email'];
$subject = $_POST['subject'];
$comment = $_POST['comment'];
//send email
mail($email, "$subject", $comment, "From:" . $email);
//Email response
echo "Thank you for contacting us!";
}
//if "email" variable is not filled out, display the form
else {
?>
<form method="post" name="testmail">
Email: <input name="email" type="text" />
Subject: <input name="subject" type="text" />
Message:<textarea name="comment" rows="15" cols="40"></textarea>
<input type="submit" name="send" value="Submit" />
</form>
<?php } ?>
答案 0 :(得分:-1)
像这样使用:
邮件(到,主题,消息,报头,参数);