按提交按钮时发送电子邮件 [英] Emailing when submit button is pressed
本文介绍了按提交按钮时发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ message =你好!这是一个简单的电子邮件。
$ from =someonelse@example.com;
$ headers =From:。从$;
mail($ to,$ subject,$ message,$ headers);
echoMail Sent。
?>
嘿,人们需要帮助!我想要有人按提交按钮,它会保存并发送输入到电子邮件的详细信息
解决方案
你必须使用这样的。确保你的按钮类型是提交
<?php
if($ _ POST){
$ to =someone@hotmail.com; $ subject =测试邮件;
$ message =你好!这是一个简单的电子邮件。
$ from =someonelse@example.com;
$ headers =From:。从$;
mail($ to,$ subject,$ message,$ headers);
echoMail Sent。
}
?>
<?php
echo $this->Form->end(__('Submit'))
$to = "someone@hotmail.com"; $subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
Hey guys need help here! I want when someone pressed the submit button, it saves and sends the details entered to the emails
解决方案
You have to use like this.Make sure your button type is submit
<?php
if($_POST){
$to = "someone@hotmail.com"; $subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
}
?>
这篇关于按提交按钮时发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文