lebron letchev
asked on
HOW ENABLE SMTP?
Dear all,
This script was working fine sometimes ago, but now it does not works, there is an error message:
Warning: mail(): SMTP server response: 554 5.5.4 Your webserver has sent too many non-authenticated messages. Please enable SMTP Authentication in your script/code to continue sending messages.
How I enable SMTP in this script?
Thank you in advance
This script was working fine sometimes ago, but now it does not works, there is an error message:
Warning: mail(): SMTP server response: 554 5.5.4 Your webserver has sent too many non-authenticated messages. Please enable SMTP Authentication in your script/code to continue sending messages.
How I enable SMTP in this script?
<?php
if (isset($_POST['g-recaptcha-response' ])) {
$captcha_data = $_POST['g-recaptcha-response'];
}
// Se nenhum valor foi recebido, o usuário não realizou o captcha
if (!$captcha_data) {
echo "Por favor, confirme o captcha.";
exit;
}
$resposta = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=6LduXAcUAAAAAAD9VXEHrm-lL_Pg-YiWcCo2_bIS&response=".$captcha_data." &remoteip= ".$_SERVER ['REMOTE_A DDR']);
?>
<?php
//if ($resposta.success) {
// echo "Obrigado por deixar sua mensagem!";
//} else {
// echo "Usuário mal-intencionado detectado. A mensagem não foi enviada.";
// exit;
//}
?>
<?php
if(isset($_POST['submit'])){
$to = "contactme@quarup.com"; // this is your Email address
$from = $_POST['xmail']; // this is the sender's Email address
//$from = $_POST['contactme@quarup.com']; // this is the sender's Email address
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$xmail = $_POST['xmail'];
$subject = "Form submission";
$subject2 = "Copy of your form submission";
$message = $first_name . " " . $last_name ."" .$xmail ." wrote the following:" . "\n\n" . $_POST['message'];
$message2 = "Here is a copy of your message " . $first_name . "\n\n" . $_POST['message'];
$headers = "From:" . $from;
$headers2 = "From:" . $to;
ini_set("sendmail_from", "contactme@quarup.com");
mail($to,$subject,$message,$xmail, $headers);
// mail($from,$subject2,$message2,$xmai l,$headers 2); // sends a copy of the message to the sender
echo "Mail Sent. Thank you " . $first_name . ", we will contact you shortly.";
// You can also use header('Location: thank_you.php'); to redirect to another page.
}
?>
Thank you in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thnak you
ASKER
Many thanks
Obviously, you have to get the authentication info from your provider. Then adjust your whole mail code to include authentication:
Take a look at the code here: http://pear.php.net/manual/en/package.mail.mail.factory.php and here http://pear.php.net/manual/en/package.mail.mail.send.php