مشكل php با بعضي از سرورها

nllu

New Member
سلام دوستان من فرمي طراحي كردم با فلش و php
ولي مشكل من از اونجايي شروع شد كه تو همه سرورهاي آمريكا و كاندادا كار مي كرد . ولي تو بعضي از سرورهاي اروپا و مخصوصا انگليس كار نمي كرد
فرمي كه من طراحي كردم فرم فرستادن ميل هست .يعني تو سايت در قسمت تماس با مدير يك فرمي گذاشتم كه بتونند كاربران به مدير سايت ميل بزنند
ولي مشكل اينه كه اين سرور انگليس مشكل داره با اين فرم ..ما هر چقدر ميل زديم به اين سرور فايده نداشت
حالا من فرم php اون رو اينجا كپي مي كنم كه اگه از دوستان تا بحال با اين مشكل بر خوردند و يا php رو كاملا يا دارند منو كمك كنند

<?

/******************************************************
**
** Flash Mx PHP Mailer
**
** powered by: nllu
*******************************************************/

/*******************************************************

Enter your site details below!

*******************************************************/

// Enter your contact email address here
$adminaddress = "[email protected]";

// Enter the address of your website here include http://www.
$siteaddress ="http://www.yoursite.com";

// Enter your company name or site name here
$sitename = "";

/*******************************************************

No need to change anything below ...

*******************************************************/

$date = date("m/d/Y H:i:s");

if ($REMOTE_ADDR == "") $ip = "no ip";
else $ip = getHostByAddr($REMOTE_ADDR);


if ($action != ""):
mail("$adminaddress","Info Request",
"A visitor at $sitename has left the following information\n
First Name: $fname
Last Name: $lname
Email: $email
Telephone: $telno\n
The visitor commented:
------------------------------
$comments

Logged Info :
------------------------------
Using: $HTTP_USER_AGENT
Hostname: $ip
IP address: $REMOTE_ADDR
Date/Time: $date","FROM:$adminaddress");

mail("$email","Happy New Year 1384 $sitename",
"Hi $fname,\n
--------------- $sitename!\n
--------------- ,
$sitename
$siteaddress","FROM:$adminaddress");

$sendresult = "------------------ <a href = \"$siteaddress\" target = \"_blank\"><u>$sitename</u></a>. You will receive a confirmation email shortly. ";
$send_answer = "answer=";
$send_answer .= rawurlencode($sendresult);
echo "$send_answer";

endif;

?>

خلاصه اعصاب ما خورد شده
اين سرور آخه php هم ساپورت مي كنه و من حتي كارمو رو سرورهاي ديگه تست كردم ولي نمي دونم چرا رو اين سرور كار نمي كنه
از طرف اون سرور به من ميلي شد كه شما بايد سبك برنامه نويسيتونو با php عوض كنيد ولي مگه خونه خالست
اين سبك رو به من معرفي كرده بود
Author Message

Carillon Industrial Services Ltd? Posted: Mon Apr 11, 2005 11:25 am
Post subject: mail() problems

--------------------------------------------------------------------------------

This may be due to lack of coding knowledge but I'm having problems
with
mail() in PHP, and forms are not sending properly. If the
register_global
settings are set to off does that affect how the function works?

Back to top


www.siliconbrits.com? Posted: Mon Apr 11, 2005 10:53 pm
Post subject: Re: mail() problems

--------------------------------------------------------------------------------

Not directly, but your code may be using globals that wont be
available.

Anyway, for mailing from a PHP page on a fasthosts server, you are
better
creating the Perl Jmail script using the example given in the White
Papers
section of this support site. (Click on White Papers above)

This is the supported method of generating emails on FH servers.

Create the script in your cgi-bin directory, and just have PHP write
the
form (given as an example in the white paper) with the perl script as
the
action command.

Oh - and note that the perl script given as an example in the White
Paper
doesn't work immediately, I had to make some mods, so if you dont know
perl
and it doesn't work for you, reply to this and I'll post a working
example
somewhere.



@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Perl Scripting With JMail


General Scripting Information


??? The scripting information provided here is aimed at Fasthosts'
customers. Much of the code is applicable to any Windows based Web
Server.
However some parameters, such as the methods used to derive the names
of the
SMTP servers, may not be valid.
Perl users should now use the JMail object in place of BLAT for sending
mail
from their scripts. If you currently use Blat, please change it.

The code uses JMail version 3. This is the current version installed on
the
servers. Detailed component information can be obtained from the Dimac
site
- http://www.dimac.net.

Before we go into detail on how to get your form working, let's look at
some
ground rules that will ensure your mail isn't blocked:

Fasthosts redirects all web based mail to an SMTP Filter System. Mails
must
have either a valid "from" or "to" address which is a domain hosted
with
Fasthosts. Any mail that doesn't fulfil these criteria is dropped. If
you
are sending mail to a customer who has given you his email address, you
need
to use the domain name of the site (note that it does not need to be a
valid
mailbox on the account) [email protected] is a fairly common one to
use.
Remember to use a valid account if you want the customer to reply to
the
email.

Fasthosts' SMTP Filter System rate limits outgoing mail from any
domain.
This prevents bulk emailing. Our limits are set to allow normal form
based
email activity to pass unhindered, but stop any persistent attempt to
send
bulk mail.

Do not use your site for mass emailing (spam). The SMTP Filter System
will
prevent this, and the information gets logged. Attempting to bulk email
will
lead to your site being closed by our abuse department.

Using JMail in Perl to Provide Email on Your Site

??? First make sure your form in the submitting page is correct. In its
simplest form it should look like:

??????? <form action="cgi-bin/jmail.pl" method="post" name="mailform">
????????? <input name="email" type="text" size="40">
????????? <input name="email_submit" type="submit" value="send mail">
??????? </form>
Now to the real scripting.

Using the example submit form above, this is the code in the jmail.pl
file.
Note that this script is placed in the cg-bin directory because it has
the
necessary permissions to execute perl scripts.

First, initialize the necessary units and set up the JMail object,

use OLE;
use CGI;
$jmail = CreateObject OLE "JMail.SMTPMail";

output the HTML headers,

print "Content-type: text/html\n\n";

and get the recipient and header information from the post page. Note
that
we get the referrer page here, and extract the domain name.

$form = new CGI;
$Recipient=$form->param('email');

$domain = $ENV {'SERVER_NAME'};
$referer = $ENV {'HTTP_REFERER'};
$url = $referer;
$url =~ s/^http:\/\///i;
$url =~ s/^www\.//i;
$domain =~ s/^www\.//i;

Next we set up the mail object,

$Sender = "noreply\@$domain";
$SMTPServer = "smtp.$domain:25";
$Subject = "JMail Example";
$Body = "This test mail sent from: $ENV{'LOCAL_ADDR'} using the JMail
component on the server via Perl.";
$Priority=3;
$Header = "Originating-IP", $ENV{'REMOTE_ADDR'};

$jmail->{ServerAddress} = $SMTPServer;
$jmail->{Sender} = $Sender;
$jmail->{Subject} = $Subject;
$jmail->AddRecipient ($Recipient);
$jmail->{Body} = $Body;
$jmail->{Priority} = $Priority;
$jmail->AddHeader ($Header);

and then check the referrer to ensure that the posting page is on the
same
site as the script. This prevents others using your script for bulk
emailing
activities - see the note at the bottom of this page.

if ($url =~ m/^$domain/)
{
$mailmessage = "mail sent";
$jmail->Execute;
}
else
{
$mailmessage = "mail was not sent.? Incorrect Referer";
}

Finally we output the results.

print "Result: $mailmessage? Recipient: $Recipient";
print "Sender: $Sender? SMTP Server: $SMTPServer";
print "Subject: $Subject? Referer: $referer";
print "Domain: $domain? url: $url ";

With Perl, all resources used are destroyed at the end of the script,
so we
don't need to close and destroy objects we have used.

Note - If you don't protect your scripts by checking the referrer, you
will
leave them open to abuse by bulk mailers. If this happens you site may
be
closed by our abuse department.

به هر حال من اين مشكل رو با اين سايت دارم
از هر كي كه واقعا بتونه مشكل منو حل كنه ممنونم
چون به چندين علت سروررمو نمي تونم عوض كنم :sad:
لطفا اگر هر كسي مي خواد به من كمك كنه به اين آي دي pm بده my id : nllu
 

alirezashiri

New Member
salam
azizam mitonid serveretono avaz konid
**************
be sorate online : ***************

*** توسط مجید ویرایش شد.

دوست عزیز در صورت تکرار جدی تر برخورد خواهد شد. لطفا از تبلیغات و مطرح کردن مسایل خارج از موضوع خودداری کنید.
 
آخرین ویرایش توسط مدیر:

nllu

New Member
عزيزم ميدونم كه سرورم عوض بشه حل ميشه
ولي من مشكلم اينه كه 15 تا سايتم رو اون سروره
و كارش بي نظيره
من مي خوام مشكل برنامه نويسيم حل شه
اين راه . درسته كه خيلي آسونه و لي بهترين را نيستش
بازم ممنون بخاطر كمك به من
خداحافظ
 

amirlol

Well-Known Member
چند سوال پيش مي آيد !!!
1) نوع سرور
2) پشتيباني از كومپانت ها
3) ورژن php (احتمالآ ورژن 5 است که نباید باشه !!!)
4)
 

جدیدترین ارسال ها

بالا