Forum Moderators: coopster

Message Too Old, No Replies

Why are emails always sent to junk mail box?

         

xbl01234

8:01 am on Dec 9, 2006 (gmt 0)

10+ Year Member



Hello;
I use the following code to send a email to someone, but the problem is that the mail never appear in the inbox, it always appear in the junk mail box. Could you tell why? please

<code>
<html>
<body><?php
function spamcheck($field)
{
//eregi() performs a case insensitive regular expression match
if(eregi("to:",$field) ¦¦ eregi("cc:",$field))
{
return TRUE;
}
else
{
return FALSE;
}
}//if "email" is filled out, send email
if (isset($_REQUEST['email']))
{
//check if the email address is invalid
$mailcheck = spamcheck($_REQUEST['email']);
if ($mailcheck==TRUE)
{
echo "Invalid input";
}
else
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("someone@example.com", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for using our mail form";
}
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?></body>
</html>

</code>

eelixduppy

2:20 pm on Dec 9, 2006 (gmt 0)



Related thread [webmasterworld.com].

Hope you find the solution in there :)

barns101

4:27 pm on Dec 9, 2006 (gmt 0)

10+ Year Member



Check that your server has a valid reverse DNS. Major email providers (e.g. AOL, Hotmail, Go Daddy and more) now appear to block all email from servers without valid reverse DNS.

You can check your reverse DNS at DNS Stuff [dnsstuff.com]

xbl01234

10:07 pm on Dec 9, 2006 (gmt 0)

10+ Year Member



>Are you sending HTML mail? if so, include an <img> in the message >that requests an image from your server Identify the recipient >using the querystring. For example:

>Add this to your e-mail message:

><img src='mydomain.com/spyimage.php?email=$toemail' height=1 >width=1>

How to add this to my massage into my code?

barns101

4:50 pm on Dec 10, 2006 (gmt 0)

10+ Year Member



Outdated advice I would say. Identifying users with images in your email is actually more likely to get the message flagged as spam. Besides that, many email programmes disable external images by default as a privacy measure, and webmail services do the same.

xbl01234

8:33 pm on Dec 10, 2006 (gmt 0)

10+ Year Member




>Outdated advice I would say. Identifying users with images in your >email is actually more likely to get the message flagged as spam. >Besides that, many email programmes disable external images by >default as a privacy measure, and webmail services do the same.

So you have any idea to improve that?

barns101

12:54 am on Dec 11, 2006 (gmt 0)

10+ Year Member



Yes, make sure you have valid reverse DNS! ;)

xbl01234

1:52 am on Dec 11, 2006 (gmt 0)

10+ Year Member



yes, i check my two name server' ip for my domain, they have valid reverse DNS. but the company which i renting a server from them say tahtthey do have a valid RDNS for our server. but they won't be able to set-up a RDNS for your domain since RDNS would need a dedicated IP address explicitly for the said domain.

barns101

2:28 am on Dec 11, 2006 (gmt 0)

10+ Year Member



As far as I a aware, a dedicated IP address is not necessary in order to have a valid RDNS. All that you need to do is make sure that your RDNS points to a domain on your server.

For example, one host that I use has the RDNS pointed to one of the name servers that they use, which resolves to the correct server IP address. I just started using a dedicated server myself and changed the default RDNS (dub.example.com) to my new domain name (examples.com) without the "www" prefix and now DNS Stuff says that it is OK. (I only have one IP address for that server

xbl01234

3:54 am on Dec 11, 2006 (gmt 0)

10+ Year Member



I confuse where i can do?

1) In the DNS Hosting, they have serveral choise, do you thing the "Modify Mail Servers" is right one for me?

Modify Domain Servers (A Record)
The domain server or A record is a record which maps a name to an ip address. The domain server preceeds the domain as in the example below.
Eg.
sales.mydomain.com.au - sales is the name of the server
123.123.123.123 - the ip address which the server points to.

Modify Domain Aliases (CNAME Record)
The domain alias or CNAME record is basically an alias for an already existing domain server. The domain alias points directly to the domain servers ip address.
Eg.
sell.mydomain.com.au - domain alias
sales.mydomain.com.au - already existing domain server

Modify Mail Servers (MX Record)
The mail server record or MX record is used to forward all email for your domain onto a third party server.
Eg.
mail.freeemail.com.au - mail server already setup to accept email for your domain

2) and in Domain Server Management;
i can add add domain name server as following;

Name IP Address
Name (eg. www):
IP Address (eg. 123.123.123.123)

The above two part, do you think which part is right for me?

barns101

11:09 am on Dec 11, 2006 (gmt 0)

10+ Year Member



I don't think that any of those options will let you edit the RDNS. My server's control panel has an option entitled "Server (Reverse DNS)" which can be edited to update the RDNS. I would ask your host how to change the RDNS for your server.

xbl01234

12:25 pm on Dec 11, 2006 (gmt 0)

10+ Year Member



Thanks, i will ask my host to tell how to change it.