PDA

View Full Version : Form results doesn't seem to hit my inbox if using a yahoo or hotmail address


AshleyQuick
08-05-2004, 07:41 PM
I do receive the results from other domains. What could be the issue?

#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);

##### SCRIPT SETUP
# Input your email address below.

# Note: Leave a backslash "\"
# in front of the @ sign!
$E_Mail = "info\@xyz.net";

# What is the location of your sendmail program?
# If you aren't sure, contact your web host.

$Mail_Program = "/usr/sbin/sendmail -t";


# If you aren't including an "email" field on the form(s)
# to be processed, who should the emails appear "From"?

$From_Address = "info\@xyz.net";


# If you aren't including a "subject" field on the form(s)
# to be processed, what should their subject be?

$Subject = "-= Work Request =-";

# Do you wish to send an automated reply to user? If yes,
# you will have to include the "email" field in your form(s).
# If yes, insert the location of reply.txt below.

# 1 = yes # 0 = no
$Send_Reply = "1";
$Reply_Template = "reply.txt";


# Where should users be redirected after a successful submit?

$Return_Link = "http://www.xyz.net/thanks.php";


# Do you wish to keep logs of all forms processed on your server?
# If so, they will appear in the "submitted" directory.

# 1 = yes # 0 = no
$Log_Forms = "1";


$Web_Address = "http://www.xyz.net";



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

if ( $ENV{'REQUEST_METHOD'} eq "POST" ) {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
} else { $buffer = $ENV{'QUERY_STRING'}; }
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value; }

@months = ("January","February","March","April","May","June","July",
"August","September","October","November","December");

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year += 1900; $month = $mon + 101; $day = $mday + 100; $date = "$months[$mon] $mday, $year";
$time = "$hour\:$min\:$sec";

@fields = ('requiredName','Company','Phone','Address','requiredRequest','EmailOne');

open(MAIL,"|$Mail_Program") || &noprogram;
print MAIL "To: $E_Mail\n";

if (! $FORM{'EmailOne'}) {
print MAIL "From: $From_Address\n";
} else {
print MAIL "From: $FORM{'EmailOne'}\n";
}

if (! $FORM{'subject'}) {
print MAIL "Subject: $Subject\n\n";
} else {
print MAIL "Subject: $FORM{'subject'}\n\n";
}

print MAIL "Submitted at $time on $date...\n\n";

foreach $field(@fields) {
if ($FORM{$field}) {
if ($field eq "main") {
$FORM{'main'} =~ s/\Q\n\E/\n/g;
print MAIL "$field = $FORM{'main'}\n";
} else {
print MAIL "$field = $FORM{$field}\n";
}
}
}
close(MAIL);

if ($Send_Reply eq "1") {
open(REPLY,"$Reply_Template");
@reply = <REPLY>;
close(REPLY);

foreach $line(@reply) {
$line =~ s/\Q\n\E/\n/g;
$fiction .= $line;
}

open(MAIL,"|$Mail_Program") || &noprogram;
print MAIL "To: $FORM{'EmailOne'}\n";
print MAIL "From: $E_Mail\n";
print MAIL "$fiction\n\n";
print MAIL "\n\n\nNote: This message was not sent unsolicited. It was sent through a form located at $Web_Address. If you believe this message was received on error, please disregard it.";
close(MAIL);
}


if ($Log_Forms eq "1") {
if ($FORM{'EmailOne'}) {
open(LOG,">>submittedfromflash/$date.txt");
print LOG "Submitted at $time on $date...\n\n";
foreach $field(@fields) {
if ($FORM{$field}) {
if ($field eq "main") {
$FORM{'main'} =~ s/\Q\n\E/\n/g;
print LOG "$field = $FORM{'main'}\n";
} else {
print LOG "<p>$field = $FORM{$field}\n";
}
}
}
print LOG "\n";
print LOG "---------------------------\n\n";
close(LOG);
}
}

print qq~
<HTML>
<HEAD>
<META HTTP-EQUIV=Refresh CONTENT=0;URL="$Return_Link">
</HEAD>

<BODY></BODY>
</HTML>
~;
exit;

sub noprogram {
print qq~
Sendmail program failed to open!<br>
Message NOT sent.<br>
Please contact the webmaster about this problem.
~;
exit;
}

mlseim
08-05-2004, 08:36 PM
Have you checked the "bulk" or "spam" box?

Maybe your email address and subject is such that the filters are flagging them as "questionable".

AshleyQuick
08-05-2004, 09:00 PM
Good catch.

I have spam assassin enabled and it was snagging it.

Thanks!