我在网站上使用 PHP,并且想添加电子邮件功能。
I have Wamp服务器 https://en.wikipedia.org/wiki/WampServer安装。
如何使用 PHP 发送电子邮件?
使用 PHP 是可以的mail() http://php.net/manual/en/function.mail.php功能。请记住,邮件功能不适用于local server.
<?php
$to = '[email protected] /cdn-cgi/l/email-protection';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: [email protected] /cdn-cgi/l/email-protection' . "\r\n" .
'Reply-To: [email protected] /cdn-cgi/l/email-protection' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
参考:
- mail http://php.net/manual/en/function.mail.php
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)