2

I have an contact form on my Wordpress blog. It currently cannot send the form submission to my email anymore. The message in my mail client as below: "A message that you sent was rejected by the local scanning code that checks incoming messages on this system. The following error was given:

"Relaying not permitted" "

I believe it needs authentication. So to solve that i need to input my client email and password into the PHP file. But I do not exactly how to input the email and password info into PHP file correctly?

My PHP code as below. Please show me how to input mail client info into this PHP file.

<?php
 $name = $_POST['name'];
 $pickupadd = $_POST['pickupadd'];
 $pickuppc= $_POST['pickuppc'];
 $dropoffadd= $_POST['dropoffadd'];
 $dropoffpc= $_POST['dropoffpc'];
 $phonenumber= $_POST['phonenumber'];
 $useremail = $_POST['email'];
 $message = $_POST['message'];
 $formcontent=" From: $name \n Pick Up Address: $pickupadd \n Pick Up Post   Code: $pickuppc\n Drop Off Address: $dropoffadd\n Drop Off Post Code:$dropoffpc\n Fone Number: $phonenumber\n Email: $useremail\n  Message: $message";
 $recipient = "myemail@gmail.com";
 $subject = "Contact Form";
 $mailheader = "From: $email \r\n";
 mail($recipient, $subject, $formcontent, $mailheader) or die("Error!") ;
 echo "Thank You!";
 ?>

0 Answers0