我没有学过php 今天下载了个网页模板 有一个发送邮件的脚本
<?php// This is the script for sending email.
// change the email address below to your own email address.
$mailTo = '[email protected]';
$name = htmlspecialchars($_POST['Name']);
$mailFrom = htmlspecialchars($_POST['Email']);
$subject = 'Message - '.htmlspecialchars($_POST['Subject']);
$message_text = htmlspecialchars($_POST['Message']);$headers = "From: $name <$mailFrom>\n";
$headers .= "Reply-To: $name <$mailFrom>\n";$message = $message_text;mail($mailTo, $subject, $message, $headers );?>这样简简单单的就能发送邮件吗?不用设置smtp pop3之类的吗 那发过去的话发件人是谁呢?
<?php// This is the script for sending email.
// change the email address below to your own email address.
$mailTo = '[email protected]';
$name = htmlspecialchars($_POST['Name']);
$mailFrom = htmlspecialchars($_POST['Email']);
$subject = 'Message - '.htmlspecialchars($_POST['Subject']);
$message_text = htmlspecialchars($_POST['Message']);$headers = "From: $name <$mailFrom>\n";
$headers .= "Reply-To: $name <$mailFrom>\n";$message = $message_text;mail($mailTo, $subject, $message, $headers );?>这样简简单单的就能发送邮件吗?不用设置smtp pop3之类的吗 那发过去的话发件人是谁呢?
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = [email protected]; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =http://www.w3school.com.cn/php/php_ref_mail.asp
手册上:bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
邮件服务器肯定得配置。只是你没看见。
发信来自哪里和邮件服务器有关。
至于from 这个,自己可以随便写。
这也就是好多垃圾邮件的所在。
很多from 都是骗人的。
你可以自己试试哦~~~
http://www.jiucool.com/phpmailer-php-email/