It Assistors..
6
这mailto:不是用于发送电子邮件,而是创建一个邮件,其中包含指定的收件人电子邮件mailto:receiver@abc.com.
例如:如果您使用的是Windows PC,并且如果您使用Outlook作为默认电子邮件软件,那么单击将在to字段中使用xyz@gmail.com打开Outlook .
如果要发送电子邮件,可以使用PHP邮件功能来执行此操作.
在表单操作而不是mail to function中添加您创建的PHP脚本文件并遵循此代码结构.
HTML:
Receiver Email :
your_php.php脚本:
$to = $_POST['to'];
//Getting the 'to' textbox data from the form
/* If you are using GET method ,then use $_GET[] */
$subject = "Your Mail Subject" ;
$message = "Your message to be sent" ;
$headers = "From: yourmailid@domain.com" ;
// If you leave the $headers from field empty,then your server mail ID will be displayed
and it may be moved to the spam section of the email
mail($to,$subject,$message,$headers);
/* Done , Your mail will be sent to the email address you want
?>
这会将邮件发送到所需的电子邮件地址.
PS PHP是一种服务器端脚本语言,所以除非你的网页和php脚本有托管服务器,否则你不能发送邮件.