如何使用PHP代码从HTML发送邮件 [英] How to send mail from HTML using PHP code
问题描述
亲爱的朋友们,
任何人都告诉我如何使用php发送邮件代码从html发送邮件。我使用上面的网址。它没有发送邮件。但它在浏览器上显示php代码
我尝试过:
Dear friends,
Any one tell me how to send mail from html using php send mail code. i use above urls. it didn't send mail. but it display php code on browser
What I have tried:
https://www.quackit.com/html/codes/html_form_to_email.cfm
http://form.guide/contact-form/php-email-contact-form.html
推荐答案
it没发邮件。但它在浏览器上显示php代码
it didn't send mail. but it display php code on browser
似乎您的Web服务器不支持PHP脚本。您必须确保已在配置的服务器上安装PHP(包括使用 PHP:mail - Manual <时的SMTP相关部分) / a> [ ^ ]),以及Web服务器配置为执行PHP脚本。
如果你有访问网络服务器的dircet,请阅读关于PHP支持的网络服务器软件文档。
如果您无权访问Web服务器配置,请询问您的主机。如果您的访问权限有限(例如通过网络界面),请阅读您的主机提供的文档或询问他。请注意,某些托管商已预先配置了PHP,但可能会将执行限制为特定路径(再次,请阅读文档或询问您的托管商)。
It seems that your web server is not supporting PHP scripts. You have to ensure that PHP is installed on the server, configured (including SMTP relevant parts when using PHP: mail - Manual[^]), and that the web server is configured to execute PHP scripts.
If you have dircet access to the web server, read the documentation of the web server software about PHP support.
If you don't have access to the web server configuration, ask your hoster. If you have limited access (e.g. via an web interface), read the documentation provided by your hoster or ask him. Note that some hosters have pre-configured PHP but might restrict the execution to specific paths (again, read the documentation or ask your hoster).
如果您要生成电子邮件表单,可以尝试此操作联系表格..
You can try this if you are generating email form contact form..
<?php
if(isset(
_POST ['name']))
{
_POST['name'])) {
这篇关于如何使用PHP代码从HTML发送邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!