L
lueung
Guest
Hi I'm running fedora3 linux, plesk 7.54. My problem is when I send mail from this function:
function mailing($to,$name,$from,$subj,$body) {
global $SERVER_NAME;
$subj=nl2br($subj);
$body=nl2br($body);
$recipient = $to;
$headers = "From: " . "$name" . "<" . "$from" . ">\n";
$headers .= "User-Agent: Mail/1.0.0\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "X-Sender: <" . "$to" . ">\n";
$headers .= "Return-Path: <" . "$to" . ">\n";
$headers .= "Error-To: <" . "$to" . ">\n";
$headers .= "Content-Type: text/html;charset=utf-8\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "X-Priority: 3 (Normal)\n";
$headers .= "Importance: Normal\n";
mail("$recipient","$subj","$body","$headers");
}
function form_get($value){
global $HTTP_POST_VARS,$HTTP_GET_VARS,$_SERVER;
$REQUEST_METHOD=$_SERVER["REQUEST_METHOD"];
if($REQUEST_METHOD=='POST')
$get_value=$HTTP_POST_VARS["$value"];
elseif($REQUEST_METHOD=='GET')
$get_value=$HTTP_GET_VARS["$value"];
return addslashes_deep($get_value);
}
function addslashes_deep($value) {
$value = is_array($value) ?
array_map('addslashes_deep', $value) :
addslashes($value);
return $value;
}
------------------------------------------
I get a failure notice:
Hi. This is the qmail-send program at ns1.liteholdings.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<lueung@ureach.com>:
63.150.151.36 failed after I sent the message.
Remote host said: 553 5.7.0 Sender lueung@ureach.com not allowed
--- Below this line is a copy of the message.
Return-Path: <lueung@ureach.com>
Received: (qmail 9143 invoked by uid 48); 21 May 2006 07:38:49 -0400
Date: 21 May 2006 07:38:49 -0400
Message-ID: <20060521113849.9141.qmail@ns1.liteholdings.com>
To: lueung@ureach.com
Subject: Please join me at this site
From: zea zea <admin@friendsforcash.com>
User-Agent: Mail/1.0.0
MIME-Version: 1.0
X-Sender: <lueung@ureach.com>
Error-To: <lueung@ureach.com>
Content-Type: text/html;charset=utf-8
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
I hope you`ll try out a new service I joined. You can connect with my friends, invite yours, post
listings, and join<br />
groups. It`s fun, it`s easy, and it`s addictive -- because it works. Let me know what you think.<br
/>
<br />
To check it out, click the Web link below. (If this link doesn`t work, copy it into your
browser.)<br />
<br> Please use this tag:<a
href='http://friendsforcash.com/index
-------------------------------------------------------------
When I use this script script below to test it works send fine:
<!--
This is a script, written and designed to test the functionality of the
PHP mail() function on a web hosting account. I offer no warrenty with
this script. Anyone can use and distribute the script freely.
-->
<html>
<head><title>PHP Mail() test</title></head>
<body>
This form will attempt to send a test email. Please enter where this test should be sent to<br><p>
<form action = "sendmail.php" method = "post" name="sendmail">
Enter an email address: <input type = "text" name = "to"><br>
<input type="submit" value="Send" name="submit"><input type="reset" value="Reset" name="reset"><br><p>
<?php
if(isset($_POST['to']))
{
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['SCRIPT_URI'];
$mail_to=$_POST['to'];
$mail_subject="Test email from $host";
$mail_body="This is a test email, sent from $uri";
$header = "Content-type: text/html\n";
$header .= "From: \"PHP mail() Test Script\"<noreply@$host>\n";
if(mail($mail_to, $mail_subject, $mail_body,$header))
{
print "Email sent successfully!<img src=\"http://dubovik.us/happygir.jpg\">";
}
else
{
print "Email did not send<img src=\"http://dubovik.us/madgir.jpg\">";
}
}
?>
</body>
</html>
-----------------------------------------
This is the header:
Return-Path: <anonymous@ns1.liteholdings.com>
Received: from ns1.liteholdings.com (ns1.liteholdings.com [64.34.168.144])
by ureach.com (8.12.9/8.12.9) with ESMTP id k4LAnN3h020609
for <lueung@ureach.com>; Sun, 21 May 2006 06:49:23 -0400
Received: (qmail 8311 invoked by uid 48); 21 May 2006 06:49:23 -0400
Date: 21 May 2006 06:49:23 -0400
Message-ID: <20060521104923.8309.qmail@ns1.liteholdings.com>
To: lueung@ureach.com
Subject: Test email from www.friendsforcash.com
Content-type: text/html
From: "PHP mail\(\) Test Script" <noreply@friendsforcash.com>
------------------------------------------
Anyone have any ideas how to resolve this issue?
function mailing($to,$name,$from,$subj,$body) {
global $SERVER_NAME;
$subj=nl2br($subj);
$body=nl2br($body);
$recipient = $to;
$headers = "From: " . "$name" . "<" . "$from" . ">\n";
$headers .= "User-Agent: Mail/1.0.0\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "X-Sender: <" . "$to" . ">\n";
$headers .= "Return-Path: <" . "$to" . ">\n";
$headers .= "Error-To: <" . "$to" . ">\n";
$headers .= "Content-Type: text/html;charset=utf-8\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "X-Priority: 3 (Normal)\n";
$headers .= "Importance: Normal\n";
mail("$recipient","$subj","$body","$headers");
}
function form_get($value){
global $HTTP_POST_VARS,$HTTP_GET_VARS,$_SERVER;
$REQUEST_METHOD=$_SERVER["REQUEST_METHOD"];
if($REQUEST_METHOD=='POST')
$get_value=$HTTP_POST_VARS["$value"];
elseif($REQUEST_METHOD=='GET')
$get_value=$HTTP_GET_VARS["$value"];
return addslashes_deep($get_value);
}
function addslashes_deep($value) {
$value = is_array($value) ?
array_map('addslashes_deep', $value) :
addslashes($value);
return $value;
}
------------------------------------------
I get a failure notice:
Hi. This is the qmail-send program at ns1.liteholdings.com.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<lueung@ureach.com>:
63.150.151.36 failed after I sent the message.
Remote host said: 553 5.7.0 Sender lueung@ureach.com not allowed
--- Below this line is a copy of the message.
Return-Path: <lueung@ureach.com>
Received: (qmail 9143 invoked by uid 48); 21 May 2006 07:38:49 -0400
Date: 21 May 2006 07:38:49 -0400
Message-ID: <20060521113849.9141.qmail@ns1.liteholdings.com>
To: lueung@ureach.com
Subject: Please join me at this site
From: zea zea <admin@friendsforcash.com>
User-Agent: Mail/1.0.0
MIME-Version: 1.0
X-Sender: <lueung@ureach.com>
Error-To: <lueung@ureach.com>
Content-Type: text/html;charset=utf-8
Content-Transfer-Encoding: 8bit
X-Priority: 3 (Normal)
Importance: Normal
I hope you`ll try out a new service I joined. You can connect with my friends, invite yours, post
listings, and join<br />
groups. It`s fun, it`s easy, and it`s addictive -- because it works. Let me know what you think.<br
/>
<br />
To check it out, click the Web link below. (If this link doesn`t work, copy it into your
browser.)<br />
<br> Please use this tag:<a
href='http://friendsforcash.com/index
-------------------------------------------------------------
When I use this script script below to test it works send fine:
<!--
This is a script, written and designed to test the functionality of the
PHP mail() function on a web hosting account. I offer no warrenty with
this script. Anyone can use and distribute the script freely.
-->
<html>
<head><title>PHP Mail() test</title></head>
<body>
This form will attempt to send a test email. Please enter where this test should be sent to<br><p>
<form action = "sendmail.php" method = "post" name="sendmail">
Enter an email address: <input type = "text" name = "to"><br>
<input type="submit" value="Send" name="submit"><input type="reset" value="Reset" name="reset"><br><p>
<?php
if(isset($_POST['to']))
{
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['SCRIPT_URI'];
$mail_to=$_POST['to'];
$mail_subject="Test email from $host";
$mail_body="This is a test email, sent from $uri";
$header = "Content-type: text/html\n";
$header .= "From: \"PHP mail() Test Script\"<noreply@$host>\n";
if(mail($mail_to, $mail_subject, $mail_body,$header))
{
print "Email sent successfully!<img src=\"http://dubovik.us/happygir.jpg\">";
}
else
{
print "Email did not send<img src=\"http://dubovik.us/madgir.jpg\">";
}
}
?>
</body>
</html>
-----------------------------------------
This is the header:
Return-Path: <anonymous@ns1.liteholdings.com>
Received: from ns1.liteholdings.com (ns1.liteholdings.com [64.34.168.144])
by ureach.com (8.12.9/8.12.9) with ESMTP id k4LAnN3h020609
for <lueung@ureach.com>; Sun, 21 May 2006 06:49:23 -0400
Received: (qmail 8311 invoked by uid 48); 21 May 2006 06:49:23 -0400
Date: 21 May 2006 06:49:23 -0400
Message-ID: <20060521104923.8309.qmail@ns1.liteholdings.com>
To: lueung@ureach.com
Subject: Test email from www.friendsforcash.com
Content-type: text/html
From: "PHP mail\(\) Test Script" <noreply@friendsforcash.com>
------------------------------------------
Anyone have any ideas how to resolve this issue?