help from the forum please

ok Zone69 that came back just perfect with the correct email address

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>';
}
?>
 
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>';
}
?>

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
 
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

That's pretty much the way it is. Listen to Snow White.

Dream Host is "..the stain on the blue dress of web hosting".


Zeprokon
 
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.
 
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.

just wondering if i have to configure anything in dreamhost concerning sendmail fonction
 
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.
 
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.

hi crashed i posted the whole mail script at the beginning of this thread is that what you mean
 
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,

exactly right. I do not believe that the script that is sending the email is even calling this class at all. The easiest fix would be to change that script to use the simple php mail that I've posted here that did work.

I don't think there is any issue with the sendmail configuration on your machine.
 
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,

can you see anything here

Code:
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']);
 
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,
 
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,

shucks nothing so i reckon there is something in the script that is not calling the sendmail mail.php file , just gonna look more now cheers buddy, it does not matter what we change it just does the same no error messages so i really think the mail.php script is not working
 
Ok, now lets see if we can get some feedback

At the end of setHeaders before the close } add

Code:
echo "headers set";

then add

Code:
echo "sendmail called";

inside the curly { bracker for the sendmail function.

Then run the script and see if we get anything
 
I am in love with all at the forum who have helped me on this one sucess it works fine i found the other file tweaked a few things with all the info from you guys and it now works , you guys are my heroes for the day , and i still love snowwhite lmao
 
Back
Top