大约需要5到7秒来执行发送电子邮件。在我的本地服务器MAMP上,这只需要半秒。在一个网站上,这需要5到7秒(而预计需要半秒),.I会非常感谢你的帮助。
<?php
$mail_to = 'rafalmietkiewicz@gmail.com'; // specify your email here
// Assigning data from $_POST array to variables
$name = $_POST['name'];
$mail_from = $_POST['email'];
// Construct subject of the email
$subject = 'Nowa osoba zapisała się na newsletter Przeglądu Psychologicznego ' . $name;
// Construct email body
$body_message = 'Imię i nazwisko: ' . $name . "\r\n";
$body_message .= 'Adres e-mail: ' . $mail_from . "\r\n";
// Construct headers of the message
$headers = 'From: ' . $mail_from . "\r\n";
$headers .= 'Reply-To: ' . $mail_from . "\r\n";
$mail_sent = mail($mail_to, $subject, $body_message, $headers);
if ($mail_sent == true){ ?>
<script language="javascript" type="text/javascript">
alert('Dziękujemy!');
window.location = '../index.php';
</script>
<?php } else { ?>
<script language="javascript" type="text/javascript">
alert('Adres e-mail nie został wysłany. Proszę spróbować raz jeszcze.');
window.location = '../index.php';
</script>
<?php
}
?>发布于 2015-03-18 02:03:26
好的,伙计们,解决方案是在/etc/hosts中添加以下行:
127.0.0.1本地主机localhost.localdomain abstynencja
(以前没有localhost.localdomain输入)
它现在就像一个护身符,但是谁能告诉我,有什么不同?
https://stackoverflow.com/questions/29105514
复制相似问题