antx16
Power Member
- Nov 25, 2007
- 584
- 1,583
not really snowwhite they are just as bad as most but they are cheap for what i need, this is a small problem that i will eventually sort out, ps thanks for stalking me lmao ;-)
ok Zone69 that came back just perfect with the correct email address
<?php
$to = "[email protected]";
$subject = "The Subject";
$headers = "FROM: [email protected]";
$message = "a test message";
if (mail($to, $subject, $message, $headers)) {
echo '<br>Mail accepted for delivery<br>';
}
else{
echo '<br>There was an error. Mail not accepted for delivery<br>';
}
?>
So if you choose "reply to", the email address is filled in with [email protected] automatically? I tried on my buddies hostgator acct and with the previous script the email address was left blank when I clicked reply even though i could see the address.
I removed all the headers except the FROM and then it worked like this:
Code:<?php $to = "[email protected]"; $subject = "The Subject"; $headers = "FROM: [email protected]"; $message = "a test message"; if (mail($to, $subject, $message, $headers)) { echo '<br>Mail accepted for delivery<br>'; } else{ echo '<br>There was an error. Mail not accepted for delivery<br>'; } ?>
explanation is simple
anything connected with DREAMHOST is either a Disaster or a Horror Story
A colleague got his site busted for "blackhat stuff" as claimed by DREAMHOST. Problem is, the guy doesnt even know the meaning of spam. This happened just 2 days ago. Dreamhost should change its name to NIGHTMAREHOST
very strange zone zone69 these two scripts both get the right anwser so i renamed my mails script files .old to see what happens and it sends the mail out normally like before with the wrong address, it seems that the script is not being taken into consideration for some reason, something is overiding the script
OK so that definitely rules out Cpanel configuration and for sure there is a script problem. Dreamhost may be crap, but we know using the most basic script it sends the mail accordingly.
Depending how many times mail is called you may want to just paste in the code I have posted here that did work for you and then call the php mail function the same way. Not sure how large the code is you are working with but if mail is called just a few times it should pretty easy to do. You would just need to set the message, subject etc as it should be.
I really don't have any other ideas since the reply-to header should definitely work. Its just that the mail class is not being called for whatever reason. Its likely hard coded somewhere in your script.
Hit me up on PM if you need any help.
I wouldn't have thought so as the simple basic script works.
Somewhere in the script your trying to use it doesn't set the headers properly, without seeing the script and working through we won't be able to tell you how to fix it.
very strange zone zone69 these two scripts both get the right anwser so i renamed my mails script files .old to see what happens and it sends the mail out normally like before with the wrong address, it seems that the script is not being taken into consideration for some reason, something is overiding the script
I agree 100% with this statement, however, to make it clearer, what is happening, is that the script that your using this file with DOES NOT actually make it into this file for some reason.
When you try to send the email, what is the page called where you try to send the email from, this is the one that needs to be checked now.
Rgds,
I agree 100% with this statement, however, to make it clearer, what is happening, is that the script that your using this file with DOES NOT actually make it into this file for some reason.
When you try to send the email, what is the page called where you try to send the email from, this is the one that needs to be checked now.
Rgds,
require_once("../../admin/includes/config.php");
require_once("class/mail.php");
if(isset($_POST['nome'])) {
$tempResult = $conn->query("SELECT * FROM config WHERE param='admin_email'");
$result = $conn->fetch_array($tempResult);
$credentials['email'] = $_POST['email'];
$credentials['name'] = $_POST['nome'];
$credentials['contact'] = $_POST['contacto'];
$credentials['message'] = $_POST['mensagem'];
$credentials['to'] = $result['param_value'];
$credentials['subject'] = 'Message From Visitor';
$mailer = new Mail($credentials);
$mailer->sendMail();
header('Location: ' . $_SERVER['HTTP_REFERER']);
function setHeaders()
{
$this->headers = "MIME-Version: 1.0\r\n";
$this->headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$this->headers .= "From: Travel Site <[email protected]>\r\n";
$this->headers .= "Reply-To: [email protected]\r\n";
}
Try changing the SetHeaders() to the following:
Code:function setHeaders() { $this->headers = "MIME-Version: 1.0\r\n"; $this->headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $this->headers .= "From: Travel Site <[email protected]>\r\n"; $this->headers .= "Reply-To: [email protected]\r\n"; }
Make sure that the file your changing is class/mail.php and it is relative to the file you just pasted from
Rgds,
echo "headers set";
echo "sendmail called";