如何通过PHP代码发送电子邮件? [英] How to send email via PHP code?

查看:63
本文介绍了如何通过PHP代码发送电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我第一次学习php,现在,我正在学习条件语句。示例中有一个email()函数。



这是代码:

mail($ to,$ subject,$ body) ,来自:$ form)



变量有其值。



每次单击提交按钮,我都会收到有关mail()函数的错误。

以下是2个错误:



注意:未定义的变量:第52行的C:\ wamp \\\\Sipherz\creg.php中的表格



警告:mail()[function.mail]:无法连接到localhost端口25的邮件服务器,验证php.ini中的SMTP和smtp_port设置或使用ini_set()第52行的C:\wamp\www \ ipSipherz\creg.php



页面应该是实时服务器,以便代码发送电子邮件吗?我正在使用WAMP服务器来测试和运行我的代码。我应该下载任何特定的应用程序或什么?如果你可以指导我会很棒。



谢谢。

Hello,

I’m learning php for the first time and now, I’m learning about the conditional statements. There was an email() function in of the examples.

Here’s the code:
mail($to,$subject,$body, "From: $form")

The variables have their values.

Every time I click the submit button, I get an error regarding the mail() function.
Here are the 2 errors:

Notice: Undefined variable: form in C:\wamp\www\Sipherz\creg.php on line 52

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Sipherz\creg.php on line 52

Should the page be live server for the code to send emails? I’m using a WAMP Server for testing and running my code. Should I download any particular application or something? It would be great if you could guide me.

Thank you.

推荐答案

to,


subject,


body,From:
body, "From:


这篇关于如何通过PHP代码发送电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆