В настоящее время у меня есть фрагмент PHP-скрипта, который отправляет электронное письмо от введенного пользователем сообщения. Это было указано GMail как спам-электронное письмо, потому что оно подделало электронную почту. Я хотел бы преобразовать свой скрипт так, чтобы он выполнял то же самое, но через SMTP-адрес электронной почты.PHP Mail to SMTP
<?php
ob_start();
include('mplookup.php');
ob_end_clean();
$email = $_POST['emailfrom'];
$human = $_POST['human'];
$text = $_POST['text'];
$address = $_POST['address'];
$city = $_POST['city'];
$footer = '<br><em><strong>Disclaimer: "Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of EG4DEMUK. EG4DEMUK will not accept any liability in respect of defamatory or threatening communication. If you would like to raise a complaint about an email sent using our tool, please contact us at <a href="mailto:[email protected]?subject=Email%20Complaint"></a>".</strong></em><p>-----------------------------------------------------------</p>
The ERC is an organisation that brings together Egyptian citizens and movements abroad, irrespective of their political or ideological affiliations. We share in common a belief in the principles of the January 25th Revolution and oppose all aspects of corruption and dictatorship in Egypt. We believe in constitutional legitimacy and work for the establishment of a civil state that reflects the will of the Egyptian people and their freedom in choosing their government.</p>';
$postcode = $_POST['postcode'];
$name = $_POST['flname'];
$message = $text.$name."<br />".$address."<br />".$city."<br />".$postcode."<br />".$footer;
$to = "";
$subject = 'Sisi\'s visit to the UK: Sent using the ERC\'s Tool ';
$headers = "From: ".$email."\r\n";
$headers .= "Reply-To: ".$email."\r\n";
$headers .= "Return-Path: ".$email."\r\n";
$headers .= "BCC: \r\n";
$headers .= "CC: $email\r\n";
$headers .= 'MIME-Version: 1.0' . "\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
?>
<?php
if ($_POST['submit'] && $human == '4')
{
if (mail ($to, $subject, $message, $headers)) {
echo '<p>Your message has been sent! Thank you for participating in EG4DEMUK\'s campaign.</p>';
}
else
{
echo '<p>Something went wrong, please go back and try again!</p>';
}
}
?>
У меня нет понятия, как перейти к преобразованию этого в SMTP. Любая помощь приветствуется.
выглядит очень много, как еще один вопрос отправил на 5 часов раньше http://stackoverflow.com/q/31522742/ - да, я знаю ... многие не может этого видеть. Это потому, что он был удален. 99% из них одно и то же, но несколько изменений/изменений, внесенных в этот. Тем не менее, те же адреса электронной почты. –
Это потому, что я еще один доброволец в той же НПО, работающей по тому же проекту – stackoverflow11
, так почему же вопрос был удален? –